Mach is generating the tool path at this point, so it's not a true simulation. MainPlanner->PathGenerate is set to true when the gcode file is loading. Stick this in your update loop to keep your plugin quiet while loading a file:
if (MainPlanner->PathGenerate) {
return;
}