Can't quite get this to work (setting mouse speed)

Why can’t I set the mouse’s Tracking Speed slider in the Keyboard & Mouse:Mouse prefPane?
I keep getting the Sytem Events error, “NSReceiverEvaluationScriptError: 4” at “value” in the line, “set value to 1.”

tell application “System Preferences”
activate
set current pane to pane “com.apple.preference.keyboard”
end tell

tell application “System Events”
if UI elements enabled then
tell slider 1 of group 1 of tab group 2 of window 1 of process “System Preferences”
set value to 1 – (MY ERROR IN THIS LINE AT “value”)
end tell
else
tell application “System Preferences”
activate
set current pane to pane “com.apple.preference.universalaccess”
display dialog “UI element scripting is not enabled. Check "Enable access for assistive devices"”
end tell
end if
end tell

I based my script on the following OS X canned script, “Set Output volume.applescript,” which works fine. My problem above has got to be very simple.

tell application “System Preferences”
activate
set current pane to pane “com.apple.preference.sound”
end tell

tell application “System Events”
if UI elements enabled then
tell slider 1 of group 1 of window 1 of process “System Preferences”
if value is 0.5 then
set value to 0.8
else
set value to 0.5
end if
end tell
else
tell application “System Preferences”
activate
set current pane to pane “com.apple.preference.universalaccess”
display dialog “UI element scripting is not enabled. Check "Enable access for assistive devices"”
end tell
end if
end tell

It’s also a good idea to make sure the mouse settings are displayed in the required pane:

tell application "System Events" to if not UI elements enabled then
	tell me to display dialog "This script needs GUI Scripting to be enabled. This may require you to enter your account password. Enable GUI Scripting now?"
	set UI elements enabled to true
	if not UI elements enabled then error number -128
end if

tell application "System Preferences"
	set current pane to pane "com.apple.preference.keyboard"
	reveal current pane's anchor "mouseTab"
end tell

tell application "System Events" to set value of slider 1 of tab group 1 of window 1 of process "System Preferences" to 1