Pre-Set Toggle Help

Hi everyone.
I’m in need of some help regarding toggle switches, I shall explain my problem.
I’m trying to program my robot to have a number of preset single button press actions that are triggered when I press certain buttons. For example: button 5D is pressed and the arm is lowered until it meets a limit switch, then button 5U is pressed and it further depresses the arm to release it (Its a catapult), the second action would be governed by a rotation sensor(Quad Encoder). I intend to have at least 4 pre-set actions available to me.
I got the system working quite nicely, but I couldn’t drive my robot around the court while performing any of the actions. (I was using functions) I have tried a variety of fixes but I haven’t been successful.
Can someone point me in the right direction to get this working properly?
Thanks in advance.

Thank you. I tried using tasks earlier, (it was the second thing I tried) but I found that something in my code was causing the motors to jitter, I was unable to fix it so I figured I might as well try something different.
I just looked again and discovered that the else statements were causing the jittering motors. Not sure how I missed that. Now it works perfectly.