If you have more than one question you can post both of them in one thread.
To loop something you have to use a recursive function that calls itself via the schedule function. What this means is that you write a function that will be call itself every so often.
function playSoundAtThirtySeconds(%client)
{
if(!isObject(%client) || !isObject(%client.player) || %client.player.getMountedImage(0) !$= MyWeaponImage || %client.player.doNotPlay)
return;
%client.play2d(MyAudioProfile);
schedule(30 * 1000, 0, playSoundAtThirtySeconds, %client);
}