You'd be better off setting that up in MAME itself by creating "vertical.ini" and "horizont.ini" files. MAME will know if the game is vertical or horizontal and load the respective configuration automatically.
Since you already have 2 MAME's:
- In the one setup for vertical games, make a copy of "mame.ini" and call it "vertical.ini".
- In the one setup for horizontal games, make a copy of "mame.ini" and call it "horizont.ini".
- Now copy "vertical.ini" and "horizont.ini" into one of the 2 MAMEs' "/ini" folder. (probably use the one setup for Horizontal, so if a game is 'undefined' (or something weird happens) it will default to "mame.ini" which has the horizontal settings [most common]).
You'll end up with something like:
D:\MAME\mame.ini
D:\MAME\ini\vertical.ini
D:\MAME\ini\horizont.ini
Now setup Maximus to use just the one:
D:\MAME\mame64.exe (or D:\MAME\mame.exe)
You will probably need to combine any (if used) files from /artwork, /cfg, /hi, /ini, /nvram, /sta and of course /roms.