I've found that running
gnome-display-properties (on 10.04 at least) will automatically detect and configure my resolution based on the monitors I have connected at the moment. Then I can simply dismiss it (using the 'Close' button, 'Apply' works also but requires confirmation which takes another click and is unnecessary). So I've added an icon to my topbar and so far that's been so much better than resetting X like I used to do that I've been to lazy to look for a one click solution or even an automatic one such as your script.
I have a large monitor at work but usually just use my laptop alone at home so its 2 clicks when I get to work in the morning and 2 when I get home.
Should have checked first. I'm actually NOT using the proprietary driver right now and I vaguely recall that's because having compiz effects was less important to me than not restarting X twice a day to switch monitors. So my answer may be completely useless to you. I'll delete if anyone can confirm that.