Even if you code your macro at 0delay to catch the gms as they pop in the zone for 0.05ms before auto-reinvis, and have your macro halt, if they zone in and see anything that gives them any reason to be suspicious, they check the zone log and your char logs.
Even if you knew one was there and stopped, it wouldn't have saved you at all. You either get caught or you don't.