I'm currently working on something that might enable a feature like this. It would start by clicking a button and then doing those actions one after the other, like a macro-building script similar to AHK, but specific to OSRS.
If that works, I will add more functionality which could enable you to start that script whenever you are attacked, for example.