Just a thought, but you can use mame32 in MAMEWAH, I used to. I have since gone to fastmame, but basically mame32 (or any mame32 derivative) will work exactly like command line mame when running through an fe. The nice part is you can modify the settings of a game in mame32 (say the screen resolution, or lightgun enabled option), and it will save these settings (under your /ini directory) and automatically run them in your fe.
Oh, make sure your ini path is set in your mame32.ini file (inipath ini)
Option 2) Add "-lightgun_device lightgun" to your default options in MAMEWAH:
Default Options = -lightgun_device lightgun
in your MAMEWAH/FILES/EMU1.CFG (assuming emu1 is MAME)
This option will enable the lightgun for all games that have a lightgun listed as their controller. (Or you could just use "-lightgun", but that enables it for all games, which may be undesirable for you)
Other useful lightgun related options:
-[no]offscreen_reload
-[no]dual_lightgun
Cheers