Hmm... Perhaps you could set the script so that it sets a global short to 0 before starting the music.
After the music starts it waits X number of seconds equal to the length of the song.
After that, it sets the global to 1.
Then if the global is set to 1, it sets the global back to 0.
Otherwise, if the global is set to 0, it plays the music, and starts the timer again.
Then set the exit door script to set the global to 1, then play the explore track, then end the music script.
This way the music script will start when you enter the door to the cell, then set it's global, reset itself after it plays, and then stop when you leave.
It will start again if you activate the door into the cell again.
In theory, this should work nicely. I certainly hope so, at least.