Tough question - I don't know of a Mame version or frontend that supports this.
What I think you might be able to do -
Read up on Batchrun and Autohotkey -
I think (if you have enough extra keys on your keyboard encoder) -
You could say program your Defender button to send D - (and make sure D is not used in MAME).
Now you either run an AutoHotKey script that sends "C:\mame\mame.exe defender" or create a batchrun file defender.brs which does the same thing named defender.brs.
The problem is that would launch the game when you press the button with the command prompt window open, but not when your frontend has focus.
I can't recall if Batchrun has the ability to assign hotkeys to .brs files, but that would do what you want.
I am pretty sure AHK has the ability to launch apps instead of sending keystrokers when a key is sent, but not sure exactly how to do that, but that is the direction you want to go.
Hopeful, this will get you started and someone else will fill in the details for you!!!!