Custom gcodes for a fourth axis? Gcode reference?

Hello folks,
I am interested in designing a custom fourth axis for the Crossfire system that would allow us to plasma cut square tubes.

I know some people have made a rotary axis by unplugging the steppers from the X or Y axis and plugging them in to a rotary axis. That will not work for my application (I need X and Y functional at all times) so I am instead curious what capability the controller has to deal with custom g codes.

Every machine I have used in the past that runs g code supports extra g codes for custom operations. Normally there is a g code reference that explains what the custom functions are.

To what extent is there additional capability on these systems for external control? Even if all I could do is toggle an external line, this would be enough to tell my fourth axis to rotate.

I suppose worst case, I could add a mechanical switch off to the side and program the head to move in such a way as to activate the switch. But something smarter would be great.

Thanks!