At a guess, since I haven't tried this, wait(1) automatically returns zero so that the calling function can continue to execute. In this case, the "return" only serves to terminate the function (which was about to happen anyway by reaching the end of the function).