You can use the "This command repeats continuously" option at the bottom right at the "Add/Edit a Command" window; This will mean the command runs until you stop all commands or close VoiceAttack.
Alternatively, you can set up a command that will toggle itself:
Begin Boolean Compare : [spotting] Equals False
Write '[Green] Spotting' to log
Set Boolean [spotting] to True
Start Loop While : [spotting] Equals True
Press Q key and hold for 0.06 seconds and release
Pause 1.2 seconds
End Loop
Else
Set Boolean [spotting] to False
Write '[Red] Spotting stopped' to log
End Condition
I've attached the latter command so you can import it.