As a postscript to the global variables debate, I have created an
extension to lua-mode which provides basic semantic highlighting, in
particular, highlighting of globals and and global assignments.
Source code is available here:
<http://www.enyo.de/fw/software/lua-emacs/lua2-mode.html>
As mentioned on the web page, due to Emacs' lack of a plug-in
interface, this is sort-of a dead end because we cannot get richer
semantic information without a lot of effort.
It might be interesting to try this extension in some real-world
development scenarios (provided that the file size limitations aren't
a problem) and see if it helps to address the global variables issue.