A common problem that plagues me is not being able to control what pairs and ipairs is targetting when used with metatables. I tend to use a "proxy" table attached to a metatable and use __newindex and __index to move all key and value pairs to a separate table to better control the behaviour of data being passed to and from the table.
But this breaks pairs and ipairs and I noticed that in Lua 5.2+ you can have metamethods for these functions:
http://lua-users.org/wiki/GeneralizedPairsAndIpairs
I was wondering if this is supported in WoW, or in general how can you find out the Lua version used in WoW. I will test this out after the holidays when I have some time but doubt WoW would support it tbh.