In Firefox, I use NoScript to do this and it works really well. I’ve been using Safari more and more frequently in recent times, however, and I am not aware of a similar solution for the Mac’s default browser.
Please note that this is for Safari for Mac OS X only and is designed specifically for the new Snow Leopard Services functionality.
I have created them as Automator Services. The benefit of making them Services is that you can then assign a keyboard shortcut directly to the script and be able to simply press that keyboard shortcut to quickly invoke the script and do the toggle. It’s a lot quicker than hunting through a script menu or launching an application and doesn’t require any third-party software.
If you’d like to use these Services, download them below. Once unpacked, drop the files in ~/Library/Services, go to System Preferences > Keyboard > Keyboard Shortcuts, select Services from the list and assign your desired shortcut to the two scripts.
These scripts use Growl to notify you of the toggled state after the script has run. You’ll need Growl installed to make full use of it.