There are some contributed scripts that do some of what you're describing documented (and available in) the wiki: see http://webwork.maa.org/wiki/Contributed_Admin_Scripts_%28Large_Installations%29.
In particular, there's a rather large and somewhat unwieldy script there I use to build courses, assign sets, and update course rosters. We also have a stand-alone system that allows our course coordinators to build the required set definition files for a given course and semester; that's not described there, as it's rather site specific.
Gavin