Observers should not be able to affect the simulation state, therefore commands sent by observers should be ignored. A better way is probably not even trying to send the command in the network code.
Note that the reveal map cheat does not work anymore for observers after this. Is that bad? If so, all commands should be checked individually, I guess.