Xrad's Trinket with SCANNER and change to FLASHY w/button delay question

Hello, New to this forum, although I have learned much from reading the posts here. I am completely new to low level programming. I only know some basics that I have taught myself in the last few weeks.

Here is my intent:
Trinket runs a loop with 2 modes. one mode(SCANNER) runs all the time except when BUTTON pressed(5v+ on pin 4 , in this case). When BUTTON pressed, mode switches to FLASHY. I am sure you have all seen these posted on line, but I made a few edits to both of these modes to work in my project.

So far, everything works perfectly. My only issue is that I would like to run the if (buttonState == HIGH) { for an adjustable amount of milliseconds(~200), which then reverts back to 'else'. This ~200ms is longer than the button 'press' time. I tried basic delays, but I think I need a way to repeat the FLASHY loop for (x)ms. Trying to do this without a timer library/code, if possible.

I know this is NOT the way to insert code....but could not find another way except .ino upload... THANKS for your time!

// this is working attempt at combining two programs FLASHY and SCANNER
// with SCANNER running in background and when momentary
// button pressed, FLASHY program runs .

#include <Adafruit_NeoPixel.h>
#ifdef AVR_ATtiny85 // Trinket, Gemma, etc.
#include <avr/power.h>
#endif

const int N_LEDS = 8; // number pixels(leds)in strip
const int PIN = 1; //neopixel strip
const int BUTTON = 4; // momentary input 5v+ to pin 4
int buttonState = 0;

Adafruit_NeoPixel strip = Adafruit_NeoPixel(N_LEDS, PIN, NEO_GRB + NEO_KHZ800);

uint8_t mode = 0, // Current animation effect
offset = 0; // Position of spinny eyes
uint32_t color = 0xff0000; // Start RED
uint32_t prevTime;

void setup() {
// initialize the LED pin as an output:
pinMode(PIN, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(BUTTON, INPUT);

#ifdef AVR_ATtiny85 // Trinket, Gemma, etc.
if (F_CPU == 16000000) clock_prescale_set(clock_div_1);
#endif

strip.begin();
strip.setBrightness(60); // brightness
prevTime = millis();
}
int pos = 0, dir = 1; // Position, direction of LEDS

void loop() {
uint8_t i;
uint32_t t;
int j;

// read the state of the pushbutton value:
buttonState = digitalRead(BUTTON);

if (buttonState == HIGH) {
//run the FLASHY loop

digitalWrite(PIN, mode);
switch (mode) {
case 0:
i = random(32);
strip.setPixelColor(i, random(color));
strip.show();
delay(5);
strip.setPixelColor(i, 0);
delay(5);

break;
}
} else {
// return FLASHY strip to SCANNER strip

digitalWrite(PIN, mode);
switch (mode) {

case 0:
// Draw 5 pixels centered on pos. setPixelColor() will clip any
// pixels off the ends of the strip, we don't need to watch for that.
strip.setPixelColor(pos - 2, 0x021401); // Dark green
strip.setPixelColor(pos - 1, 0x0c6b0a); // Medium green
strip.setPixelColor(pos , 0x19f215); // Center pixel is brightest
strip.setPixelColor(pos + 1, 0x0c6b0a); // Medium green
strip.setPixelColor(pos + 2, 0x021401); // Dark green
strip.show();
delay(150);

// erase and redraws pixel sequence.
for (j = -2; j <= 2; j++) strip.setPixelColor(pos + j, 0);

// 'center' pixel bounces off ends of strip
pos += dir;
if (pos < 0) {
pos = 1;
dir = -dir;
} else if (pos >= strip.numPixels()) {
pos = strip.numPixels() - 2;
dir = -dir;
}
break;
}
}
}

if (buttonState == HIGH) { for an adjustable amount of milliseconds(~200), which then reverts back to 'else'.

This doesn't make sense. Do you want the switch (NOT button) to have to be high for 1/5 of a second before switching modes? If not, what do you want?

I want the FLASHY part of the program to run for 200ms following a momentary BUTTON trigger at PIN 4. I only want a 'momentary' BUTTON press to activate FLASHY loop which will then run for ~200ms.

As it is now, it only runs WHEN the button is pressed and for as long as BUTTON is held closed.

I tried a few variations of 'for' loop without success... .. Here is vid showing the neopixel action and button action:

Thx Paul for reply. I figured it out. Just added the correct fields into the 'for ' statement for the loop. works like a champ. Although not in milliseconds, I am able to adjust the ;< (X) for what I need. Also, the FLASHY runs continuously during button 'press and hold' AND functions with button 'momentary' for the # of runs , in this case 149.

I added the underlined statement:

if (buttonState == HIGH) {
//run the FLASHY loop

digitalWrite(PIN, mode);

for (int case0 = 0; case0 < 150; case0 ++) {

switch (mode) {

I am sure this is not the most elegant way to write this code, but it works very nicely without error and the switching between SCANNER to FLASHY and back to SCANNER is immediate.

One more thing: when the FLASHY loop run ends, the SCANNER loop picks up right where it left off. It does not start at beginning of scan like at power-up. Neat visual continuity.

REALLY COOL!