Putting this macro in use will only make the rogues having each other as focus. Because the macro's will have absolutely no idea whether you pressed the key on window1 or window2, making them both execute the macro and putting each other as focus. New idea is needed here.

As someone said before, swapping windows are probably bind to some key, like F12 or wherever you may have put it. On that very same button you use to swap, put an ingame focus macro for the respective character/windowswapping-key.