The code I gave you technically isn't a loop, it was just an example to show how snd_playing() worked. However, everything you need to know about sounds, loops and such are in the manual. I learned from the manual and this forum and the occasional tutorial.
Code:
function playBgMusic()
{
while(1)
{
if(snd_playing(mySnd) != 1)
{
mySnd = snd_play(mySnd,50,0);
}
wait(1);
}
}
Call it in function main.