Setting up all your commands for that functionality could be possible, if tedious.
Rather than using a Boolean value, you can use an integer that is incremented when a command starts, and decremented when it stops, so that if the value is 0, theoretically no other commands are running.
This would require a plugin or inline function that resets the value to 0 if all commands are stopped, too.
Obviously a major limitation of that technique is that any command you don't (and/or can't) modify won't be included in the count.
Another option would be to have all your other commands set up with the "Allow other commands to execute while this one is running" option disabled, while your "Querying command" has both it and the "Always execute this command" options enabled.
You can then use a separate command that does not have the "Always execute this command" option enabled, and have it set a variable when executed, E.G.
check if command is allowed to execute
Set Boolean [~~noOtherCommandsAreRunning] to True
Where your "Querying command" then uses an inline function to execute that command not as a subcommand (as otherwise the executed command takes on certain properties of the calling command, including the "Always execute this command" option), then check whether the variable was set, E.G.
Inline C# Function: Execute command not as subcommand, wait until execution finishes
Begin Boolean Compare : [~~noOtherCommandsAreRunning] Equals True
Write [Blue] 'This should be the only running command' to log
Else
Write [Blue] 'Other commands are running' to log
End Condition
Where "Execute command not as subcommand" contains
public class VAInline
{
public void main()
{
VA.Command.Execute("check if command is allowed to execute", WaitForReturn: true, AsSubcommand: false);
}
}
Note that this assumes that the "Cancel Blocked Commands" option on the "System / Advanced" tab of the VoiceAttack options window is enabled, as it is by default.