I've needed a simple method to pass a state back from a M1xx user function to the interpreter, so I've created a patch that interprets exit codes from 32 to 63 (not used as linux standart exit codes) not as fault but set #5399 to this value. Maybe some one find this useful, too. The drawback is that it empties the motion queue (like M66 for example). An alternative approach could be the use of a M1xx.1 function and leave the M1xx behavior untouched.
The patch also fixes an issue with zombie processes afer aborting a gcode prog while M1xx running.