In order to force out any code you need to format as so...
"G54", or "G55", just place that where you want the code to come out. Remember to end the line with an "e". So if you want to force out G54 on it's own line it would look like this.
As for understanding how they are written and work that would take way more space than I have here, but if you have questions about how to get something done in your PP post them up here and I'll do my best.