Based on my experience coding, I can tell you this will be no simple feature to make.

To make this possible, the easiest way is to make macros accept logic gates. What that would entail however, would be the ability for people to start legitimately botting without a 3rd party program - because "if"/"while"/"for"/"else"/"etc" is exactly what is necessary to write working software (bots). It is possible to write a program (game in this case) that lets you write "Scripts" (kinda like macros needed to make your idea work) that you can manually program, but I think some very fundamental rules in the game will have to be changed for this to be a good idea.