My current script involves two functions; i'll call it SwitchMain and SetMaster for the sake of simplicity:

SwitchMain does a few things:
Reposition/resizes the next WoW Slave window (let's call this "Slave1") into the "Main" window position (reposition/resize)
Reposition/resizes the WoW Main window (let's call this "Main") into one of the "Slave" positions
Renames the old "Main" into "Slave1", and renames "Slave1" to "Main"

SetMaster:
Sends a hotkey to "Main" to activate a macro (/jamba setmeasmaster, autopromote to leader)
Sends a hotkey to all "Slaves" to activate a different macro (/clear focus, target party1 - the new leader, and make him focus)

On all keystrokes:
All action hotkeys are sent unmodified to "Main". All "Slaves" receive Key + modifier to perform that same action, except with target focustarget (Example: /cast [mod:alt, target=focustarget] Sinister Strike)

I combined a lot of functions obviously (SetMaster is also my follow-me macro, it also does jamba invite, etc.).

It works perfect in a group environment, but doesn't work in Raid or if someone else is group lead. I'm trying to brainstorm different ways of making a fool-proof way to make all my slaves make the new master it's focus. I'll probably try something like /cleartarget on all slaves, /target self on main then do an assist train lol. Not the most elegant solution but since setting master really should be a one-time action it might work.