I just sent you V5.3.1
This works good on my desktop, with me imagining that the screen is turning counter clockwise from horz to vert.
Here are screen shots of my mala options, plus you can see how the mala screen is turned with the monitor horizontal.
Whatever you changed in this version makes the menu rotation work properly, and only rotate 1 visible flip. Well done!
I still get occasional IOErrors. I think I've tracked them down to happening if..
1.) You have your StartCom settings set prior, and go into Mala's config menu, and change them. Save the settings and exit. Choose a few games. I receive warnings every time a new game starts until I reboot Mala. The issue seems to subside thereafter.
2.) Flipping back and forth between Mame vertical and Stella horizontal. I think what's going on is that your MRotate plugin should not let go over MALA control until the rotation is absolutely finished. For instance, LedBlinky speak and spell doesn't allow your MRotate to be called until he is done talking. Then for whatever reason, Mala says it's time for Startcom to go. I'm guessing startcom does what it needs to figure out which way to rotate, then calls the external MRotate. Control is then passed to allow the emulator to begin launch, but Mala and MRotate are still possibly checking each other back and forth to verify if rotation is finished
It appears Stella has a 50/50 chance of loading in the foreground, and is rather random. What I can tell you for sure, is that if you start Mala in the Stella emulator, all ready rotated horizontally, you can launch Stella games all day and not loose focus. It's when you flip from Mame to Stell (with or without monitor rotation) when the focus appears to be lost.
I'd say move onto embedding Mrotate into DLL and see if that helps any. Otherwise, I suspect you and loadman should have a chat about plugin priorities, or possibly even multithreading or allowing the user to define order of opperation somehow.
-csa