You´ve to use a handle. Example:

var sndhandle;
sound music_snd = <music.wav>;

...

sndhandle = snd_loop(music_snd, 100, 0);


...

snd_stop(sndhandle); <-- With this command you can stop the music / sound


no science involved