No no no.... VERY easy with Visual Basic...
First, get FMAME32. This version of MAME announces what game it's running when you start it for use with things like LED marquees. It does this by Captioning the window with the romset name.
Write a Visual Basic program to scan all windows open on desktop and if it finds one labled "MAME: Game Name [romesetname]" parse that info. (Very easy to do, all windows opened are part of a collection. Can be a 4 line For Each... loop.
check [romesetname] vs. a list of all vertical games.
If it matches, check if the monitor is already vertical. This you can control in the program. You don't need it to actually "check" to see if it's there or not. Just as long as the program keeps track, you're alright. Heck, you could save the last setting to disk so it remembers on next bootup. A manual way to synchronize it would be highly recommended.
If the game matches one on the list, and the monitor is hoz, trigger.
If the game isn't on the list, and the monitor is vert, trigger.
All else, don't trigger.
Trigger is simple, there are about 10,000 Active X *.OCX files on the internet for simple Parallel port control via Visual Basic. Get one. They should be compatible with ALL versions of Windows. Just drop it into your VB form, and send it the command you want. It's a peice of cake.
You could even trigger it on a TCP/IP request with 3 lines of code and the WINSOCK.OCX if you wanted to...
Hell, have it scan every 3 seconds for a windows change. If you close the game, make it turn back to horizontal so you can use FMame. The only problem is constant degaussing though, unless you rig the degaussing circuit into the flip control (tricky to do, are you good with electronics? I'm not
)
Test it with a LED or something before you hook it into your motor control.
This is all assuming your motor control circuit can be changed like flipping a light switch.
It's something I've been considering too, but havn't really looked into since I'm really good with VB and the project sounded very simple.