Yeah it's annoying.
The script flow I use, not at my PC so you'll have to work it out yourself but here.
Issue MCC command 10037 -1 (this should toggle detaching the display)
Using Autohotkey, you'll want something along the lines of "WinMove, ahk_class JRiver Display Class" adding in the correct coordinates for the desired display device, and then maximize the window OR execute the MCC command for Fullscreen.
I just have this mapped to a button on my tablet control interface. I'm pretty sure the script I'm using has a bit of sanity checking to reduce undesired behavior but I'd have to look.