Have you recompiled the script after changing the code?
Also you might want to try stepping through the code using the "Run Line-by-Line" button to find out where it's got a problem.
The only thing broken I can see is the waiting stuff. Don't know why I missed that in the first place, but in PAL you cannot "wait" inside of IF statements.
To fix that you can replace the IF by a loop with only one iteration:
IF Song['songtype'] = 'S' then
VAR skip : boolean = false;
while Song['songtype'] = 'S' and not skip DO
And before the loop ends:
skip := True;