Obviously I have been playing with gcode since I have been doing some 3dprinting. I finally got the user defined language to work with gcode from CURA in order to be able to collapse layers. Took a bit of trial and error but here is what I got so far.
Below is the file for the xml file to be imported into user defined languages. Just save then import.