I think you could do this with romlister.
http://www.waste.org/~winkles/ROMLister1) create an ini file like you've described below, call it c:\horizontal.ini
2) kick off romlister, select batch file output.
3) in the batch file creation popup window, type "copy c:\horizontal.ini %rom%.ini"
4) do a search for all horizontal games only
5) save the output as a file
6) run the batch file from your mame folder.
It should copy horizontal.ini to a file named whatever rom name is needed.
this is all from the top of my head, so your experience may vary.