I know of AutoHotKey and I know of AutoScriptWriter but my issue comes down to timing.
I'm trying to reproduce user input into an application but the application sometimes has a loading time for some functions, other times it doesn't, basically I need to have a script writer be aware that if I don't press the mouse button for 5 seconds, the script writer puts a Sleep in the script for 5 seconds, but if I wait 10 seconds, it puts in a Sleep in the script for 10 seconds, and so on. Right now AutoScriptWriter puts in Sleep 100 as default which is too short and I don't want to go through the script manually after wards trying to remember if this click was supposed to wait 5 or 10 seconds or have just a small sleep.
Thanks all.

Alt-pfor a 5 second wait) and then do a find/replace in the script on that keystroke and replace with thesleep 5000or whatever. – yhw42 Apr 1 '11 at 18:54