That is exactly what conditions and values are for.
Your "Deploy" command would look something like this:
Begin Boolean Compare : [LandingGear] Equals False
Press G key and hold for 0,06 seconds and release
Set Boolean [LandingGear] to True
Else
Say, 'Landing gear already down'
End Condition
Your "Retract" command would be the inverse:
Begin Boolean Compare : [LandingGear] Equals True
Press G key and hold for 0,06 seconds and release
Set Boolean [LandingGear] to False
Else
Say, 'Landing gear already up'
End Condition
For the "Boolean Compare" you'll want to have the "Evaluate 'Not Set' as false" option checked.