Time limit on for(int loop

Ok so after punching in all the code, clearing errors and reading it over a few times its starting to make since. This is going to be an amazingly useful function. I haven't added the rest of my loop but I can tell now that it will work fine once I get this nailed. So heres my lightning sketch thanks to Arrch and copiertalk. If you have time, please check.

unsigned long lastCycleTime;
int mixer = 0;
int doNothingFlag;
int led = 11;
int burst; //short burst of light
int big;
int srumble;
int brumble;
int diming;
int delaymix;
int doNothingTime;



void setup() {                
 
  pinMode(led, OUTPUT);     
}

void loop() {
lastCycleTime = 0;
int doNothingFlag = 0;
unsigned long now = millis();

if ( (doNothingFlag == 0) && (now - lastCycleTime > mixer) )
{
  doNothingFlag = 1;
  lastCycleTime = now;
  doNothingTime = random(1000,12000);
  
}
if ( (doNothingFlag == 1) && (now - lastCycleTime > doNothingTime))
{
  doNothingFlag = 0;
  lastCycleTime = now;
  burst = random(10,500); //Short burst of lightning value
  big = random(1000,4000);//long burst of lightning value
  srumble = random(10,40);//lower light lighting value
  brumble = random(10,255);//
  mixer = random(burst,big);//random pick of short or long bursts of lightning
}
  if ( (doNothingFlag == 0) && (now - lastCycleTime < mixer))
  {
    diming = random(10,100);
  analogWrite(led, random(srumble,brumble));//Turn on LED for short or long burst
  delay(diming);//random number
  }}