What do you mean by "detect", exactly?
You can keep track of which commands have already been executed that would have affected the state of ingame systems, but you can't have the game "tell" you those values without an intermediary.
If Elite dangerous has some sort of API to get that data from you could write a plugin to get it into VoiceAttack, provided you're proficient with C#.
An example of using variables to keep track of states:
Extend Cargo Scoop
Begin Boolean Compare : [ScoopExtended] Equals False
Press S key and hold for 0,06 seconds and release
Set Boolean [ScoopExtended] to True
Else
Say, 'Scoop already extended'
End Condition
Retract Cargo Scoop
Begin Boolean Compare : [ScoopExtended] Equals True
Press S key and hold for 0,06 seconds and release
Set Boolean [ScoopExtended] to False
Else
Say, 'Scoop already retracted'
End Condition