EDDI is wonderful, but it cannot provide data on the status of hardpoints (deployed or no) as that info is not published to the player journals.
The documentation implied this, but I don't own the game, so I wasn't sure how hardpoints work.
If I may provide a few thoughts on your command, if I understand it correctly, you could compress it to the following:
[Deploy; engage; retract; disengage;] [the;] [hardpoints; hard points; weapons; armaments; guns]Execute command, '((Hardpoints))' (by name) (and wait until it completes)
Begin Text Compare : [{EXP: '{LASTSPOKENCMD}' LIKE 'deploy*' Or '{LASTSPOKENCMD}' LIKE 'engage*'}] Equals '1'
Set Boolean [hardpoints] to True (save value to profile)
Execute command, '((RS - Hardpoints Deploy))'
Else If Text Compare : [{EXP: '{LASTSPOKENCMD}' LIKE 'retract*' Or '{LASTSPOKENCMD}' LIKE 'disengage*'}] Equals '1'
Set Boolean [hardpoints] to False (save value to profile)
Execute command, '((RS - Hardpoints Retract))'
Else
Execute command, '((RS - Hardpoints))'
End Condition - Exit when condition met
I'm using the "{EXP:}" token to provide "Or" functionality, and the wildcard at the end of the word to match will function as "Starts with".
Whether you use "{EXP:}" or not, there is no need for individual checks, as all statements are mutually exclusive:
Begin Text Compare : [{LASTSPOKENCMD}] Starts With 'deploy'
Set small int (condition) [temp] value to 1
Else If Text Compare : [{LASTSPOKENCMD}] Starts With 'engage'
Set small int (condition) [temp] value to 1
Else If Text Compare : [{LASTSPOKENCMD}] Starts With 'retract'
Set small int (condition) [temp] value to 2
Else If Text Compare : [{LASTSPOKENCMD}] Starts With 'disengage'
Set small int (condition) [temp] value to 2
End Condition
Using this structure, when "{LASTSPOKENCMD}" starts with, for example, "deploy", that is the only check that needs to be processed, because the other three cannot be true.
Also, it's not necessary to use the "Wait until this command completes before continuing" option for the "Execute Another Command" action in the final section of the command, because no processing occurs after that. Execution of the other command cannot "step on"(create a race condition) your original command.