the Else Exitapp lines from the script, means the script will stop checking (exit) if you press NO, presumably to stop you getting the same prompt again the next second.
try this instead:
#SingleInstance Force
#Persistent
#NoEnv
SetTimer, Timer, 2000
Timer:
OldValue := OutputVar
RegRead, OutputVar, HKEY_CURRENT_USER, Control Panel\Accessibility\StickyKeys, Flags
IfNotEqual, OldValue, %OutputVar%
If OutputVar <> 511
{
MsgBox, 68, Sticky Keys, The Sticky Keys are turned off. Would you like to turn them on?
IfMsgBox Yes
RegWrite, REG_SZ, HKEY_CURRENT_USER, Control Panel\Accessibility\StickyKeys, Flags, 511
}
Return
This way when stickykeys goes off but you dont want to turn it on the script won't ask again until stickykeys has been turned on manually and goes off again. Also made the script less cpuhungry by only checking every 2 seconds and the script no longer runs at maximum speed.