Perhaps worth mentioning that we already have an inspector widget that does a lot of this. We can open an inspector window for 'anything' and see fields, current field data, nested hierarchy (e.g. pointers/refs to other Lua tables), etc. Main usage right now is, in fact, debugging UI -- Adam at one point had it such that you middle-mouse-clicked on any on-screen widget to bring up an inspector window for it. Of course, the best part is recursively opening inspectors on inspectors of inspectors
No code/source line info but that is surprisingly-easy to add with Lua's debug library. The debug library is (as you might expect for a dynamic language), insanely-powerful.
So...already implemented for the most part
Will need to dust it off once mod system is done so that we can dump a list of mod files that have injected fields and/or logic into entities / ui elements.
EDIT: Whoops..didn't realize this was a necro. Dang, we need more scripting/modding talk going on..