These simple script toggles TouchPad [ enabled | disabled ] status. It does not need any additional parameters or in-code variables settings: all IDs should be found automatically. It can be used instead of or in addition with automatic TouchPad disabling function. The best is to bind it to the special "X86TouchpadToggle" key on the keyboard if it is present.
It was developed for and tested on my ThinkPad X220t under Arch Linux with "xf86-input-synaptics" installed.