Based on this hint, which I found quite useful, I created this bash script which toggles Dashboard's active status via the defaults write command. If the Dashboard is enabled (disabled) and you run the script, it will now be disabled (enabled). This script is for those who would rather use a Unix script than another preferences pane binary to handle things like this this ... or for those who like to muck around with Unix, like me!
I originally posted the following as a comment on the hint referred to above, but I think people might find it useful for general use and modifications or for just learning more about Unix, so here it is.
[robg adds: This script works as described, and is quite useful for other things, too. With easy edits, you could use it to set the value of any "toggleable" preferences setting, such as the one that automatically accepts video iChats. In addition, you can create your own program to toggle Dashboard using either AppleScript or Automator from the Finder. For AppleScript, just open Script Editor, and create a new one-line script: do shell script "/path/to/dash_toggle_script" (use the actual path, obviously). Save that as an application, and you have a double-clicable application to toggle the dock -- commenters will, I'm sure, enhance my example to show you the status of the Dashboard when running the script, as my simple script runs blindly.
You can also make an application using Automator. Launch the program, click on Automator in Library, then drag Run Shell Script from the Action column into the work area on the right. Leave the shell pop-up set to bash, and then replace cat with /path/to/dash_toggle_script, except use the actual path -- in my case, it was ~/bin/docktoggle. Select File: Save As and set the File Format to Application. Once saved, you'll again have a double-clickable application that you can use to toggle Dashboard on and off.]
Mac OS X Hints
http://hints.macworld.com/article.php?story=20050805062400200