You are doing some weird stuff, just go simple.
Don't make the macro in Logitech totally unnecesair and will give problems.
1- You want to do a mouseover dispel magic, here it is:
Code:
#showtooltip
/use [@mouseover] Dispel Magic
2- You need to keybind the side keys to a keyboard key, for example I keybinded them to "PG UP", and "PG DN". It's a useful binding overall and can be used in games without much trouble.
3- After binding your mouse the next thing you need to do is bind that keys in game so you can use them.
In my case I would keybind "PG UP" and "PG DN" in a free bar slot in the WoW interface.
4- Next step is placing the macro you made in wow in the bar slot you keybinded your side mouse. If everything is correct every time you press your mouse button will trigger the macro palced in the bar.
If you need help with macros I would gladly help, I like doing them :)