Here is a sample of what I am talking about, Al. There is tons of stuff you can add to make your machine safer to operate, or simply more foolproof.
The real "guts" of the G codes are actually quite simple, as you indicate, because the basic motion controller commands are quite simple.
When you have full control, you can experiment, too. Try the G0 without a DECELSTOP and see what happens. Etc., etc.
There was no way I could have done my lathe retrofit with CNCLite. It would be one thing if they told you what logic they were using in the CNC Lite Gcodes, but it is invisible.
Here is a sample I cut from my own cbk. I'm not going to explain it, but you can probably decipher some of what I was up to
~@~GCODE.FIL
DISPLAY1 t :TEXT 1;t :\81=t
IF\99=0THENIF{\3+\4}=0THENIF\5=1THENLABEL2 YOU FORGOT TO PROGRAM SPINDLE FWD/REV :[CYCLEBUTT] :EXIT
LABEL2 ;11
IF\99=0THENIF\5=1THENLABEL2 SPINDLE IS STOPPED;12 'detect a stopped spindle by M5 flag
DECELSTOP
RAPID z;{x/2};0
IF\99=1THENIFt<>\408THEN\408=t :FILEWRITE (T\408) :READNOTE \409 :FILEWRITE (\409) :FILEWRITE M0
IF\99=0THENIF\5=1THEN [CYCLEBUTT] 'if a dryrun is not in progress then if an M5 was not cancelled my an M3 or M4 ,go to the macro
\100=z
\101=x
-----G0
IF f=0THENLABEL2 YOU FORGOT TO SPECIFY A FEEDRATE;12 :[CYCLEBUTT] :EXIT
LABEL2 ;11
IF\99=0THENIF\5=1THENLABEL2 SPINDLE IS STOPPED;12 'detect a stopped spindle by M5 flag
GO z;{x/2};0
IF\99=0THENIF\5=1THEN [CYCLEBUTT] 'allows the program to run through with axis locked M31
\100=z
\101=x
-----G1
IF f=0THENLABEL2 YOU FORGOT TO SPECIFY A FEEDRATE;12 :[CYCLEBUTT] :EXIT
IF\99=0THENIF\5=1THENLABEL2 SPINDLE IS STOPPED;12'detect a stopped spindle by M5 flag
'CW z;{x/2};0;k;i;0 'this is for I,K arc centers
CW z;{x/2};;r
IF\99=0THENIF\5=1THEN [CYCLEBUTT]
\100=z
\101=x
-----G2
IF f=0THENLABEL2 YOU FORGOT TO SPECIFY A FEEDRATE;12 :[CYCLEBUTT] :EXIT
IF\99=0THENIF\5=1THENLABEL2 SPINDLE IS STOPPED;12 'detect a stopped spindle by M5 flag
'CCW z;{x/2};0;k;i;0 'this is for I,K arc centers
CCW z;{x/2};;r
IF\99=0THENIF\5=1THEN [CYCLEBUTT]
\100=z
\101=x
-----G3