LED Blink without delay- controlling the blink number

First post for help so a little nervous in sharing my trials and tribulations.

I am using a Mega to control a PWM fan and to drive a 4D systems screen that shows two voltages from 2 pots for a car project I am doing.

I have the two arduino sketches that work perfectly sepatately, but when I combine them the screen gets screwed up. I think this is somethng to do with the comms between Arduino and the screen and the fact that I have long delays in the PWM fan code which allow it to blink an LED everytime a button is pressed to increase the speed of the fan. I have read that during delays any screen COMS are lost which could explain everything

In the fan code I have 5 fan settings (fanMode) and the LED blinks once when the button is pressed for low speed, twice for a higher speed, three times for a higher speed etc......

Currently the code in loop() is a simple loop ...and this works well on its own

if (fanMode < 5) {
for ( int i = 0; i <= fanMode - 1; i++ ) {
analogWrite(LedPin, 0);
delay(300);
analogWrite(LedPin, LedBrightness);
}
}

I basically need to replicate this without the delays and the loop I guess as loops will lock out the screen?. I have tried to think my way through the blink without delay sketch everybody seems to quote for this but this sketch directs the LED to blink for ever rather than limiting it to a set number of blinks. So the question is: how do I replicate the above without a loop and a delay. At this stage I would appreciate some help in confirming whether this can be done at all with blink without delays sketch and an ideas on how to takle it rather than asking for direct code advice.

but this sketch directs the LED to blink for ever rather than limiting it to a set number of blinks.

Create a boolean variable. Only blink the LEDs when the boolean variable is true, count the blinks and set the boolean to false when enough have been done. Reset the counter variable to zero and the boolean to false to start the blinks again.