I have done something similar for my Nuvo Grand Concerto Wall Panels. I wanted to be able to push a button (When on a certain source) and have it trigger a script in premise to read me the weather. I created a "Source 6 Controller" module from the "Other Serial Device" class. It still has all the Transport Commands and Play/Pause, Volume, mute, etc. I then just created an "OnChangePause" event and when somebody pushes the play/pause button, it fires a script.
Not sure how it looks on the browser interface, as I have not used it to any extent. Works good as far as having a source to select in the Nuvo Grand Concerto Driver.
I have something fun for you :