I can think of 2 possibilities. Maybe others will have suggestions.
1. You can enable and disable command groups in VC. Many users do this, for example, if they use MediaMonkey for music but Kodi for video. When MM is launched, VC can disable Kodi command groups and vice versa.
http://voxcommando.com/mediawiki/index.php?title=Actions#Group2. You could have a command with a variable that keeps track of true or false, on/off, whatever. Use an if/else based on the variable's value. (If currently on, then button press will trigger fan off, else button press triggers fan on, style of thing.)
Evaluate the if/else before resetting the variable.