How to interrupt long command with G-code?
3D Printers are pretty basic when it comes to g-code. There is no cycle start or cycle pause function on them. There is also no g-code command to interrupt the previous command. To get it to a halt you could turn it off. Or if the printer's firmware is configured to do so, you can touch one of the limit switches to get it to stop its movements.