The df-to-unit is actually a python script; it operates completely independently of DF. I coulda made it in C++ or whatever, and I even did make it in C++ way back when, but I decided that making people download .exe files would be too much hassle (for the security-minded).
As for DFHack with Lua: the Lua API has
real nice documentation.. Modifying raws in-game will be ineffective; it'll work while you're playing, but items already made of materials won't be affected AFAIK and all raw changes will be reset upon the world being regenerated anyway (unless you modify the raw files with Lua directly). Changing individual creatures is fairly easy; you don't even need scripting experience, just highlight them and type "gui/gm-editor". If you want to make a script to automate that kind of thing, you're going to have to learn about the data structures... which gm-editor will do just fine, as long as you remember that everything you use "enter" to enter in gm-editor can be accessed in Lua like so.
For example (for this example, define "->" as "press enter on"):
unit->status->current_soul->personality->emotions
can be accessed with Lua like so:
unit.status.current_soul.personality.emotions