I can explain the above code if that helps, what you were asking for went a little above basic Gcode(;-).
A good read is PeterSmid's "CNC Programing, second edition" BUT it can be quite a read for a beginner BUT it does have a help CD encluded. I still use it as a referrnece from time to time.
He does a good job of explaining.
IF you need a BASIC learner there is one on the WEB I'll try and track it down again and let you know.
THe book is:
Easy CNC - A Beginners Guide to CNC
I have NOT read it myself but it does come recommended(;-)
(;-) TP