If I were you I would take things one step at a time to find the problem.

First, without AHK, does Xbutton1 on the mouse trigger Mouse4 in WoW?

Second, with AHK, write a script that sends Xbutton1 to one copy of the game when you press a key. Does it trigger Mouse 4?

Third, with AHK, write a script that sends Xbutton 1 to one copy of the game when you press Xbutton 1. Does it trigger Mouse 4?

Finally, write a script that sends Xbutton 1 to multiple copies of the game when you press Xbutton 1.