Translations:Extension:Scribunto/Lua reference manual/1464/en

The return statement must be the last statement in its block. If for some reason a return is needed in the middle of a block, an explicit block  may be used.