I believe I have a working solution for you:
Command 1
\/\/\/ Cue Manager Header \/\/\/
// If the command is requested by the user(instead of the cue manager)
Begin Text Compare : [{CMDACTION}] Equals 'Spoken'
// Check both the variable that indicates a command is running, and the cue in case a command has just finished, to try and prevent a race condition
Begin Condition : [commandRunning] Equals True OR [commandQue] Does Not Equal ''
// Make sure commandQue exists, to prevent "Not Set" being the first entry in the cue
Begin Text Compare : [commandCue] Has Not Been Set
Set Text [commandCue] to ''
End Condition
Begin Text Compare : [commandCue] Does Not Equal ''
// Add the requested command to the end of the cue
Set Text [commandCue] to '{TXT:commandCue}{CMD};'
Else
// Add the requested command to the start of the que
Set Text [commandCue] to '{TXT:commandCue}{CMD};'
// If the command cue was empty, start the cue manager so it can run the next command(s) once the currently executing command finishes
Execute command, 'Cue Manager' (by name)
End Condition
Write [Purple] 'Cue Manager: "{CMD}" added to que' to log
End Condition - Exit when condition met
End Condition
Set Boolean [commandRunning] to True
/\/\/\ End of Cue Manager Header /\/\/\
Write [Pink] 'Doing things in {CMD}...' to log
Pause 5 seconds
Write [Black] 'Done doing things in {CMD}.' to log
\/\/\/ Cue Manager Footer \/\/\/
Set Boolean [commandRunning] to False
/\/\/\ End of Cue Manager Footer /\/\/\
Cue Manager (voice disabled)
// If a command is running, wait for it to finished before starting the next one. This needs to happen here when the command that starts the manager is still running
Start Loop While : [commandRunning] Equals True
End Loop
// Keep running until all commands in the cue have been executed and the que is empty
Start Loop While : [commandCue] Does Not Equal ''
// Get the next command from the beginning of the cue
Set Text [~~nextCommand] to '{TXTSUBSTR:commandCue:0:{TXTPOS:";":commandCue:0}}'
Write [Blue] 'Cue Manager: Starting command "{TXT:~~nextCommand}"' to log
Execute command, '{TXT:~~nextCommand}' (by name)
// Remove the executed command from the cue
Set Text [commandCue] to '{TXTSUBSTR:commandCue:{EXP: {TXTPOS:";":commandCue:0} + 1}:}'
// Wait to make sure the command has started and has set commandRunning to true. Depending on your system this may need to be longer or shorter
Pause 0,1 seconds
// If a command is running, wait for it to finished before starting the next one
Start Loop While : [commandRunning] Equals True
End Loop
End Loop
// Pause so the end message doesn't appear before the command actually finishes(race condition)
Pause 0,1 seconds
Write [Blue] 'All cued commands executed' to log
This allows you to speak any command wrapped in the header and the footer, and the cue manager will execute them in the sequence you've spoken them in.
The commands are attached as a .vap to this post, so you can import them.
Notes:
In the header, you'll noticed the section
Begin Text Compare : [commandCue] Does Not Equal ''
// Add the requested command to the end of the cue
Set Text [commandCue] to '{TXT:commandCue}{CMD};'
Else
// Add the requested command to the start of the que
Set Text [commandCue] to '{TXT:commandCue}{CMD};'
// If the command cue was empty, start the cue manager so it can run the next command(s) once the currently executing command finishes
Execute command, 'Cue Manager' (by name)
End Condition
It's set up this way because determining if the cue is empty(which decides if the cue manager should be started) must happen before adding something to the cue(otherwise the cue manager will never start, as the cue would contain what was just added to it).
This necessitates repeating the "Set a Text Value" action, as it must still run in either case.
The use of "commandRunning" combined with waiting loops seems a little clumsy, but because the first command is not started by the que manager command, the "Wait until this command completes before continuing" option of the "Execute Another Command" action can't be used, so it's necessary.
I chose this option because this allows you to add the header and footer to any command to make it a que-able command, while still allowing non-quing commands to run simultaneously(E.G. media player control by multimedia keys, which shouldn't interfere with your checklist system).