While I have not quite got this one cracked yet I found a script that came close.
The script is the equivalent of pressing the top left + window button. which toggles the window between its optimised size and the last user defined size.
I also have quick silver installed and added ctrl-m to trigger the script.
I keep the script in ~/Scripts
tell application "System Events"
if UI elements enabled then
set FrontApplication to (get name of every process whose frontmost is true) as string
tell process FrontApplication
click button 2 of window 1
--button 2 is the green "zoom" button for all applications
--window 1 is always the frontmost window.
tell application "System Preferences"
set current pane to pane "com.apple.preference.universalaccess"
display dialog "UI element scripting is not enabled. Check 'Enable access for assistive devices'"
I did not write the script and unfortunately cant remember where I got it to credit the writer. If you know the original source let me know.
if it does not run you probably need to set the execurtable permission from the terminal
chmod u+rwx maximise\ app.scpt