Set a flag that you've pressed a button via a functional global or using a

global variable

and put your sequence code in the Periodic Tasks VI. If you leave it in your Teleop or autonomous you'll not be happy ... it'll block your execution and cause you code to have delays you don't want ...