IIRC, the external trigger jack on the SX50 is wired in parrallel with the built-in shutter button. They both poke the same bit in the button hardware variables.
If so, a script to do what you want will be trivial. In fact something tells me I have posted something like that in the past but it will probably faster to recode and test it that find it again. Give me a day or two unless someone else posts first. I need to find my SX50 so that I can test the script.