This can be solved if you maintain an own list of track objects, which can contain any values/ids you like. On startup you setup the notifiers for the name and insert/remove/swap actions and use them to keep your internal list of track objects updated. I have done a similar task already in my snapshots tool, maybe you can strip it down to your needs.
It contains also code to save data along a song and restore it on song load, which may be useful instead of saving your track comments into the song comments field.