It should be possible to define some settings regarding a tool change:
Maybe the code can get some inspiration from the tool change code of gcnccam. Another interesting forum thread is at cnczone.