return doesn't work in functions with wait or sleep...
when a function hits a sleep or wait, it returns the value of the wait to the calling function.
like this:

function return1()
{
wait(2);
return(1); //this function returns 2, not 1.
}
function return2()
{
wait(32); //this function will return 32, not 2
wait(12);
return(2);
}

maybe this behaviour changed in 6.4, i got this results from a test i did in 6.31.4, but i think i should still be the same. but then in your case it would return -1, not 0... maybe for negative values it returns 0, i don't know...

hope i could help,
Filipe