You shouldn't need a script unless you want to add complexity like get the last tool etc. Theres a press and release. Just set the press to the track tool and the release to something like the select tool or move.
Have you tried using lower button on your pen as right click and upper button as a mid click? I use tablet in maya as well, so I can tell its really comfortable and no extra scripts needed.
hey guys...I use a tablet to model in maya, and its very hard to me to use the default alt + mmb to pan the viewport....I changed the default Track Tool to the letter "S", however, when I press the "S" key it stays on the track tool until I press the "Q" key to exit the function. I really need to to create a script to…