Have you tried adding a keyboard shortcut to do this
go to system preferences/keyboard/keyboard shortcuts
hit the plus sign
type in Detect Displays
Then add a shortcut
logout or restart and give it a try, i cant verify that this works!
let me know if not and i can write a new script