No I don't think so. I had a brief look into it and wrote a small program which turned the wifi off if you press the volume down button but because this program has to run in the background and process every single button you press and check if it is the corresponding button the device becomes very sluggish. Even up to the point that it seems undetermined which process will receive a keypress event when one of the two is running in background.
You see what I do is all reverse engineering and "best guesses" but unless PB publishes an official SDK with a good documentation it would be very hard to get any further with any slightly sophisticated task (and even trivial programs like turning off wifi). I know how to programmatically do it but don't know how to trigger my program from a keypress without waiting all the time for a keypress event.