Have you looked at add_form_elements in acs-subsite/tcl/attribute-procs.tcl?
There's a bunch of other attribute metadata Tcl wrappers in there, too. Not all of it works.
Anyway ... as I mentioned earlier there's duplicated (but more sophisticated) code in the content repository that does similar stuff.
What we really need to do is to plan out our strategy to do the automagical form generation, data insertion, data editing stuff so that we can look forward to the day when we have one API to do so that's comprehensive and works.
Then we'll be able to lash together packages with a lot less effort and if they can be done through a decent API of this sort, can have them support both RDBMSs out of the box, to a large extent.
Your demo's slick but it represents a third code branch which works towards using metadata in this way.
We may be stuck with two due to there being so much redundancy in the CR of features found in the object model and these features in somecases are grafted onto rather than organically part of the rest of the toolkit. Merging is probably more a medium-term than short-term proposition.
But ... let's work towards having one fully-functional API for standard objects rather than work in parallel!
There are several of us currently interested in, and to a varying extent looking into, solutions. You, Lars Pind, me, Jeff Davis, Dan Wickstrom at the moment (there are others, I'm sure)
How can we best coordinate our efforts so we don't double up?