M5 turns off the spindle so deleting that line might help. M30 may shut the spindle off also, depends on the controller software. It may be possible to replace the M30 with an M2, but i'm not sure if it would cycle again. Can't hurt to try.
On the other hand, it doesn't seem safe to leave the spindle running when changing parts, but I'll leave it to you to evaluate the conditions.