What do you mean by 5 ticks? If you want to set a timeout for 5 ms or seconds, you should use the Sleep parameter as follows:
Sleep 5 ; milliseconds
Sleep 5000 ; 5 seconds (5000 ms)
Sleep % var ; if you need to use a variable instead of number
There is also a variable called A_TickCount
tick := A_TickCount
while(tick + 5 < A_TickCount) ; 5 ticks
continue
; I guess this code will execute in 0.1 ms, so try to turn the tick up
In your case:
click
sleep 5000 ; change this if necessary
click right
It works fine for me.
Learn more about Click
: https://autohotkey.com/docs/commands/Click.htm