Resike asked me on IRC to make something for highlighting globals, could look like this:
(Yes,
io and
arg should be highlighted, this was just an example while I work out the kinks)
The only downside is that you'd have to have Lua installed (it don't run Lua scripts, but it requires the Lua compilator to find the globals properly).