Best approach - Button press to stop blinking light game - Replace delay

As PaulMurrayCbr mentioned a loop(any loop) isn't a problem if it only takes a few microseconds to complete. The longer it takes and it starts becoming a problem. From your description it sounds as there is a high probability it could take too long but testing is the only way to be sure.

A for loop is generally used to iterate a specific number of times.

for (byte i = 2; i < 43; i++)
{
  pinMode ( i, OUTPUT); // Set pins 2-42 to outputs
}

A while loop repeatedly executes as long as a given condition is true.

while (digitalRead(button))
{
  Serial.println ("Press button to exit this loop"); // continually print this till the button is pushed
}

And yes it is possible to break out of a loop, but it's somewhat rare to need to.

The take away here is that loops ARE blocking code and as such should be kept short.