ThisThe following example AppleScript code will toggle the state of the "Use grayscale" checkbox in Accessibility under System Preferences in OS X Yosemite (tested under 10.10.4) regardless of what was last selected under Accessibility as it tells System Preferences to open directly to the location of the "Use grayscale" checkbox and toggle its state.
tell application "System Preferences"
activate
reveal anchor "Seeing_Display" of pane id "com.apple.preference.universalaccess"
tell application "System Events" to tell front window of application process "System Preferences"
clickwith thetimeout of 5 seconds
repeat until (exists checkbox "Use grayscale")
of window "Accessibility" delay 0.1
end tellrepeat
click checkbox "Use grayscale"
end telltimeout
tell application "System Preferences" toend tell
quit
end tell
The next issue is how you want to execute it. The problem surrounding setting it as a Service through Automator to use a Keyboard shortcut without the use of a third party utility is every application that receives the shortcut key combo will need to have permission to do so and that becomes a pain unless you only choose e.g. Finder instead of all applications. So without a third party utility I'd either save it as a script in the Users Script folder and then access it from the Script menu in the Apple menu bar or as an application.
The settings for the Script menu in the Apple menu bar are in the Script Editors Preferences. Then it's just two mouse clicks anytime you want to toggle the state of the "Use grayscale" checkbox. One to click the Scripts menu and another to click the script name.
As an application it can be placed in the Dock and then it's a single mouse click anytime you want to toggle the state of the "Use grayscale" checkbox.
In either of these two cases you'll have to give permission under Accessibility on the Privacy tab of Security & Privacy in System Preferences in order to run it successfully.
As a side note, if you use a program like FastScripts, you only need to use the example AppleScript code as a .scpt saved in Script Editor, not create an Automator service using the mentioned workaround in the comment and can assigned the keyboard shortcut in the Preferences for FastScripts.
Note that I am not affiliated with the developer of FastScripts, just a satisfied user.