I do it a little differently, i use a focus macro, it is very simple IMO. I am guessing you use a pip to swap out your main and other toon, so lets say you use f9 to swap to your main, then you make a macro

/focus Wtsdots, and bind it to f9

and then for your other toon do it lets say on f10

/focus wtsdotz and bind to f10

Then when you pip or lets say your main window is up you click f9 which makes both toons focus on your main, then you set up your spells like this

/cast [target=focustarget] (spell here)

and your golden, you can do it either way up too you ... GL!