WP should provide a built in means of including javascript files and their dependencies. This has been discussed on wp-hackers at least twice (most recently: http://comox.textdrive.com/pipermail/wp-hackers/2006-April/005917.html).
The attached patch establishes a method to define and use WP javascript, reworks the admin section to make use of this method, and calls this method both in admin-header.php and in the wp_head hook. The patch keeps track of all scripts and their dependencies, which scripts are slated for inclusion on the page, and which scripts have already been included on the page.
Perhaps a little overkill.