You could always use the new(ish) _device options in mame.ini...something like:
trackball_device mouse
adstick_device joystick
I haven't messed about with stuff for a while, but IIRC this should only enable those devices when neccessary, ie mouse will be enabled for trackball games, and joystick enabled for analog stick games.
Sorry, I'd forgot about that previously.