Since you didn't say what version of macOS you are running, here is the AppleScript code I'd use to toggle the target checkbox under macOS High Sierra. It may need to be modified for macOS Mojave and later.
Also note that when assigning a global keyboard shortcut, it can not be one already assigned to any app that has focus when the keyboard shortcut is pressed.
You can use this code in a Run AppleScript action in an Automator Service.1
- 1 In macOS Mojave, and later, an Automator Service is called a Quick Action. There are also other minor nomenclature differences but they should be more obvious when comparing them to pre-macOS Mojave Automator workflows.
The keyboard shortcut can be assigned in: System Preferences > Keyboard > Shortcuts > Services
Example AppleScript code:
if running of application "System Preferences" then
tell application "System Preferences" to quit
do shell script "killall 'System Preferences'"
repeat while running of application "System Preferences" is true
tell application "System Preferences" to ¬
reveal pane id "com.apple.preference.trackpad"
tell application "System Events" to tell application process "System Preferences"
repeat while not (exists window "Trackpad")
tell tab group 1 of window "Trackpad"
click radio button "Point & Click"
repeat while value of radio button "Point & Click" is equal to 0
click checkbox 3
quit application "System Preferences"
Note: The example AppleScript code is just that and does not contain any additional error handling as may be appropriate. The onus is upon the user to add any error handling as may be appropriate, needed or wanted. Have a look at the try statement and error statement in the AppleScript Language Guide. See also, Working with Errors.