Could you just insert a T1 at the end of your custom Gcode?
The T1 at the top gets changed to a TO straight away anyway, so it's not really doing anything.
At the end of your custom, it's printing on T0, so if You add a T1, it should print with that, I assume.