Large 3D printer 10'x10'x4' - Need G-code to tell when it stops extruding and to stop machine We use Simplify and have a large 10’x10’x4’ printer. We need G-code that when the extrusion stops the machine will stop and raise 10&nbsp;mm as to not to burn the print, so we know where the extrusion stopped. 

We are using beads instead of filament, which work great. We have a mechanical pusher of beads that once it stops spinning, we need a G-code to recognize it is not spinning anymore and to stop the printer at that point and to lift up 10&nbsp;mm. Printer might go 3-4 days sometimes a week with no problems and all of a sudden no extrusion and machine keeps thinking its printing. We have to start all over. 

Any suggestions?
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).