This is what you want:
http://www.mmorpg.com/discussion2.cfm/post/4718278#4718278
This is a variation of the above bound to Mouse Button 4:
Note that it occasionally gets 'stuck' and requires an additional press to get it 'unstuck.'
Disclaimer: Be aware that using scripting tools (even for plugging functionality that should be in the game by default) is generally frowned upon by others in the community because tools like this can also used to enable automation of gameplay and is against the EULA which can result in infractions / bans. Basically, if you're going to use it - it's at your own risk, don't abuse it with automation and don't broadcast it - just in case.
Thread, interrupt, 0
;
Xbutton1::
Toggle := !Toggle
If Toggle{
Thread, Priority, 2147483647
Click Down Right
}
Else{
Thread, Priority, 2147483647
Click Down Right
Click Up Right
}
Return