Have you looked at using nsv variables? I think that this is exactly what they are for.
http://www.aolserver.com/docs/devel/tcl/nsv-commands.html
Or is this what you were talking about?