Super old post but if anyone ever comes around looking for ways to generate CFG files for newer versions of Mame, I made a LUA plugin a while back that does it:
https://github.com/Jakobud/configgenerator
It will generate a full cfg file with all inputs and dipswitches.
Easiest method is to create some sort of .bat script that runs "mame -bench 1 <romname>" for each game. My plugin will do the rest.