No, a local variable does not only exist in the current function, etc. You just cannot see local variables in nested scopes, but the other way round of course works. Also Lua does not instantly dispose local variables once you exit a scope.
You probably want to read this:
http://lua-users.org/wiki/ScopeTutorial
But as correctly said, you should use locals whenever possible. Simply declare the local outside of your function. You do not need to assign a value, but declare the name.