you can use wmctrl to do this .. i've done some of this in the distant past myself.
if you specify __exactly what you want in detail and in what WM/DE you are using i'd be happy to code it for you .. probably just 5 or 6 easy lines. otherwise just google wmctrl and hack through it.
one interesting aside - i run two monitors as two separate X screens. none of that twinview/xinerama crap. The only drawback is I cannot move a window from one monitor to the other, as they are two separate X servers. Yesterday I discovered a program called "XPRA" which is basically "GNU screen for X11". I was finally able to get a proof of concept script working where I could send any window over to the other monitor
(and my laptop in the other room
However, due to the way XPRA works as a client/server/proxy based solution and not a DMA remap, the performance of a window with video in it is crap... it's basically a little better than ssh -X. So back to the drawing board on that one. If anyone has any suggestions I'd love to hear it - however I doubt anybody does, as i've googled this one to no end for years.