It would take longer, but if the issue IS Server lag, just increase your weights from 3's to 4's or 5's. This would ensure that the previous action would have executed and completed before the next command gets sent.

Somebody else posted that most of these style of errors are not server lag, but routing/latency issues. Those of us who are completing endgame battle-oriented combat often have to resort to various methods to tunnel/vpn directly to a datacenter, or else the so called "Server lag" kills us via Landslide. Once you understand it's not the server, or the client that is the actual problem, the problems go away.

Fortunately, I live near Toronto/Montreal, and I experience a minimal amount of latency issues. my old laptop and PS3 have low performance, so I don't perform any tasks that depend on fast reaction time. my Desktop and my PS4 on the other hand work flawlessly. Also, I have similar macro's to the one you posted, and have not had any issues.