Unfortunately changing track colors from a tool is the same as changing it manually, so the song registers a change that can be saved or discarded, it makes tools behave in a way that their actions can be undoed by the user without the tool dev doing any work, which is a big win in most cases, but not here.
I asked for a feature in the API to allow bypassing this for this and other tools that do similar stuff. With that it would be possible to avoid this issue but there are possible problems with such feature that might not worth the few cases it’d be useful (see taktik’s response there) so it might never happen.