First run a trace. If you open the GPP file somewhere near the top will be a line (if its not there put it below the variable declaration in @initpost)
; trace "all ": 5
remove the semi-colon, save the file and then post the program. The output you get is what the CAM is putting out in terms of variables so if you scan down for your rogue lines you will see what routine is calling it; my guess it is either an @line or @rapid and you are returning to the start point set in Tool Settings 9but I may be wrong). Then you need to build the logic to handle the output toget the code you want.
Likewise, if you want your post to have dual unit functionality there need to be logic in the GPP to detect what units are being used in the CAM and then call the G95 or G94 accordingly. Some users prefer to have separate post processors for imperial and metric; it comes down to personal choice.
If you need more, study the GPP help pages in SolidCAM or download the GPP manual from the SolidCAM website.