Aktan - of course that would fail; you have a variable declaration on the last line of your script :P
In all seriousness though, implied return last doesn't happen unless the last line of a script is a clip and is not a variable declaration containing a clip. So while
Language: avisynth
a = AVISource("a.avi")
b = AVISource("b.avi")
out = stackvertical(a, b)
would fail due to not having a return value,
Language: avisynth
a = AVISource("a.avi")
b = AVISource("b.avi")
stackvertical(a, b)
should work (since stackvertical returns a clip and you're not declaring a variable on the last line)
With all that said, I don't like relying on implied last and implied return last since that makes things harder to read. So I would end up using
Language: avisynth
a = AVISource("a.avi")
b = AVISource("b.avi")
return stackvertical(a, b)
# or, if this were being used as the final script and not a source script, I'd do the following
out = stackvertical(a, b)
return out