Let's examine the first few lines inside the while(1) loop:
music_handle = snd_loop (niceloop_wav, 50, 0);
while (vec_dist (plbiped01_entity.x, my.x) > 100) {wait (1);}
temp_volume = 50;
while (temp_volume > 5)
{
snd_tune (music_handle, temp_volume, 0, 0);
temp_volume -= 1 * time_step;
wait (1);
}
Since the sound isn't faded out, I believe that the player doesn't come closer than 100 quants to the entity that is supposed to trigger the music change, so you should increase 100 until the player is able to trigger the change. Another possible problem could appear because player's pointer name isn't the proper one.
Let me know if you need more info.