I’ve added an error message for the failed save.
M8 or M9 will be emitted after any layer change based on the setting for that layer, to make sure that the assist is properly set. I don’t track the state because they don’t get emitted that often, and it’s not harmful to repeat it.
For the G1 with no coordinates, is that right at the end? I know we emit a G1 S0 at the end to be sure the spindle (laser) is off, but I don’t think there should be any others.