Large 3D printer 10'x10'x4' - Need G-code to tell when it stops extruding and to stop machine
G-code is likely not the solution to your problem. G-code are simple commands that are executed by the printer (e.g. "heat up the hotend to this temperature" or "move the extruder to this position") but there is no G-code for "detect whether the pusher is still running" (and besides, how could the printer possibly detect whether the pusher is running without hardware to do so?

You'll likely want to configure your pusher to somehow act as a filament runout sensor. This is a feature in Marlin (smoothieware has something similar) that allows you to pause the print by making an input on one of the control board's pins. You'll need to build hardware that detects the motion of the pusher, and if the motion is interrupted, pulls the FIL_RUNOUT_PIN low (in the case of Marlin). You can then configure what should happen next (e.g. raising the head and stopping the print) using FILAMENT_RUNOUT_SCRIPT (again, only if you're using Marlin).