Obtain a boolean True when there is no command running in Rhino

Is there a way to listen to the active Rhino command and to send a True Value when there is no active command running (or when it finished running)?
I could use such a thing as a workaround for this issue: