Looking over the documentation for
DocumentRoot (and
<VirtualHost>), it looks like your options are to write a script to create the configuration (as you mentioned) or write a module if you want to automatically set DocumentRoot. If you're using Apache 1.3, the source for
mod_example may be helpful in writing a module.
Alternatively, if you don't have many users and create new ones infrequently, automatic configuration may not be worth the effort.