I think you want a music pause/play function,
here is an example :

Code:

var mediaHandle;
var isPlaying = on;

panel crtlPanel
{
pos_x = 0;
pos_y = 0;
layer = 1;
button = 0,0,<pauseOn.bmp>,<pauseOff.bmp>,<pauseOn.bmp>,musicOnOff,null,null;
flags = visible;
}

function musicOnOff()
{
if (isPlaying == on)
{
isPlaying = off;
media_start(mediaHandle); // if you want to start it all over again,
} else { // change it to media_play
isPlaying = on;
media_pause(mediaHandle);
}
}

function main()
{
level_load(yourLevel);
wait(2);

mouse_mode = 1;
media_play("yourMusic.wav",null,1000); // adjust the vol. (1000)
mediaHandle = media_handle;

while(1)
{
mouse_pos.x = pointer.x;
mouse_pos.y = pointer.y;
wait(1);
}
}



Use your own bmp and media file off course.