Not having a router in the game (I have Nomads), I do totally agree with @Jeffish that there should be a chance to turn the router off before the end of the gcode (usually M2) but that would probably be handled by a pause… It’s been a looong time since I had a manually-controlled spindle, and that was on my CNC-converted Sherline 5400…
As to the motion itself, when this came up a while back (2017) @WillAdams wrote
Yes, Grbl goes back to machine origin when M2 or M30 is sent.
There was an extended discussion here
And a smaller one here
IMHO it should still be the responsibility of the gcode generating program to raise the Z to a safe height, not knowing what might happen next… I’ve always written my post-processors so…