Improve the check for valid hook commands

It is now cleaner coded and faster.
Change two forgotten calls of zone_has_remove_tag