The following code will do it use GUI scripting. It actually opens up system preferences clicks on what you want and then exits. Note that the delays are to give time for windows and such to open and can be shortened from 1sec as necessary for your system. Also the heart of this script is in the line where it "select row 3 of..." you should change row 3 to the appropriate row in your system pref screen box.
Hope this helps.
tell application "System Preferences"
activate
set current pane to pane "com.apple.preference.displays"
end tell
tell application "System Events"
tell process "System Preferences"
click radio button "Color" of tab group 1 of window "Color LCD"
delay 1
select row 3 of table of scroll area of group of tab group 1 of window "Color LCD"
end tell
end tell
delay 1
tell application "System Preferences"
quit
end tell
This can be easily edited into a toggle switch using if else statements or ask for your input to which display to go to.