Hmm well after playing around for a while (I haven't done much scripting/skinning experimentation for ages, damn uni
) I have managed to add a button with a custom cmdid using a skin and using Mnjul's subclassing dll I have managed to output a message to the debug console when this button is pressed. So this seems like it works ok, but it comes with the problem of having to create a skin for it to work (and if the user already has a skin...)
As for creating a menu, there would need to be some way to communicate with the script from within the dll code so that the script knows when the button is pressed. I couldn't figure out a way to do this in my brief experiment using Mnjul's method (maybe this is easier with the old invisible subclass window method).
It's fun to play around with, but I'm too tired atm and should really be revising...