just use your mouse software and record a macro of you going from two hotbar slots (e.g. 1,2,1,2...) that toggles on and off with a side mouse button. I believe it works better if you leave more of a delay after pressing 1 and before you press 2 (but this probably doesn't matter just experiment...