With the little amount of programming experience that I have, I would venture a guess that making a game work in mame would be difficult, to say the least.
If you are capable of programming a game, there wouldn't be much of a reason to go to the extra work to make the game run in Mame, even if it is possible. (Since Mame generally runs in windows, you could just program a game to run in windows. Then, just make all the controls correspond to Mame controls. This is my perspective anyway.)
For instance, I have used Macromedia to program some very simple games that work using mame controls. Basically the only difference is that you click on the game .exe instead of running mame.
Anyway, that is my opinion.
I hope that helps.