Yes, this is possible. Obviously there are potential security issues,
but I've basically ignored those for my situation. The technical issue
is that you need to safely encode the Tcl so it doesn't confuse the SQL.
That means quotes and newlines at a minimum. Also, because our DB is
dumped in a text format, we needed to encode some additional characters
that would confuse the backup system, like tabs.
There are a couple of stupid tricks you can do with this. For one thing,
the Tcl code can go delete itself from the db, vanishing without a
trace. For another, you can overwrite existing code. That is, you can
have a proc or class defined in your "on disk" code that is overridden
by the "in the DB" code.