I found a pragmatic but functional solution. Simply enter the identical tool change command once at section TOOLCHANGE and once at section RAPID_MOVE.
Sounds like your machine is similar to our Morbidelli, where there are no "toolchange" commands. The tool # is specified at the beginning of each operation, and toolchangeers are done automatically when required.
So, I have the code for the beginning of each operation in the begin Rapid Move section, after the actual rapid move.