I found a solution for Yosemite (in Swedish, though, but you should be able to “anglify” it…).

This link shows a script on how to find the right UI elements:
http://jjmcclintock.com/wordpress/?p=662

These are my two changes in your script.
The right name for the UI element:
— check the current value of the checkbox and change it if needed
tell checkbox 1 of tab group 1 of window “Trackpad”
— (“Styrplatta” in Swedish)

And quitting:
— leave the trackpad preference pane
tell application “System Preferences” to quit.

The entire script:
——–
— want it on or off?
display dialog “Turn trackpad-clicking on or off?” buttons {“Cancel”, “Turn Off”, “Turn On”} default button 3 with icon note
if (button returned of result) is “Turn On” then
set theValue to 1
else
set theValue to 0
end if

— open the preference pane
tell application “System Preferences”
activate
reveal (pane id “com.apple.preference.trackpad”)
end tell

tell application “System Events”
tell process “System Preferences”
— check the current value of the checkbox and change it if needed
tell checkbox 1 of tab group 1 of window “Trackpad”
repeat until exists (* wait until the object is accessible *)
delay 0.2
end repeat
if value is not theValue then click
end tell

— leave the trackpad preference pane
tell application “System Preferences” to quit
end tell
end tell
——–

Great job on the script though, thanks!
/Mattias