How about dedicating a keyboard LED for this ? I've got a J-pac and it can output this as a signal, and instead of a LED I can connect a low-current relay. I'm not interested in using the LED's for anything else.
I also think there are some people rotating monitors with relays this way, depending on the orientation of the game.
Since Powermame "knows" when and how to switch a 49 way stick, why couldn't it carry out the (simpler) task of switching between 4 and 8 way ? The information needed is apparantly already there ?