i extended functionality to background music slightly. The thread is at Playing music tracks in sequence.
i have upgraded that script recently but not reposted. if anyone is interested let me know and I'll post it.
The key to the whole thing is to extend the 2da with a new collumn. I actually make a new 2da for ambient music called ambientmusic_x.2da and in that 2da include a column for the length of the track in seconds. I did this as an integer, but it might be better to do this as a float if you are able to get the precise length of the track.
I do this all crudely. I simply look at the file in a music app and look at the running time, then enter that value in the 2da. Then once I have that information the script can be used to change the background music when the track ends.