turring off part of a code with a switch?

can you turn off (and on) parts of a code with a switch? not to actually trigger the event, but to enable the event to be triggered.

basically i want to "comment out" a few lines with the push of a button then bring them back in to the loop with another push.

for example, this would be the original state of the line:

    delay (150);

then with the push of a button have it turn act like this:

//  if(sample4.uniquePress()){
//    MIDI.sendNoteOn(69,127,1);  
//    delay (150);
//    MIDI.sendNoteOff(69,0,1);  
//      }

then on the next push have it revert back to the original state.

i know the commenting out will not be the way to achieve it, that is just how i want it to behave.

there must be a way, but i haven't been able to get my head around how to make it happen.

Just count occurences of the event you want, and only trigger on, say, even numbers.

do you know of any sort of example i could look at? i haven't been able to find something like that in the reference section.

the triggering on even numbers part shouldn't be any problem, i'm just not sure of how to turn remove a section from the loop.

It's just another enclosing conditional - no need for an example.

oh man, the light bulb above my head finally lit up. :o

yeah, i was making it seem way more complicated than it needed to be. thanks a lot!