More efficient loops

I have a project where I want to loop a flash 400 times then carry on how would I do this?

here is the code so far;

int pin13 = 13;
int pin12 = 12;

void setup()
{
  pinMode(pin13, OUTPUT);
  pinMode(pin12, OUTPUT);
}

void loop()
{
  day(); eve(); night(); eve();
}

void night()
{
  digitalWrite(pin12, HIGH);
  delay(240000);
}
 
void day()
{
  digitalWrite(pin13, HIGH);
  delay(420000);
}

void eve()
{
  digitalWrite(pin13, HIGH);
  delay(112.5);
  digitalWrite(pin13, LOW);
  digitalWrite(pin12, HIGH);
  delay(112.5);
  digitalWrite(pin12, LOW);
  digitalWrite(pin13, HIGH);
  delay(112.5);
  digitalWrite(pin13, LOW);
  digitalWrite(pin12, HIGH);
  delay(112.5);
  digitalWrite(pin12, LOW);
  digitalWrite(pin13, HIGH);
  delay(112.5);

I want to loop the eve part

digitalWrite(pin13, HIGH);
  delay(112.5);
  digitalWrite(pin13, LOW);
  digitalWrite(pin12, HIGH);
  delay(112.5);
  digitalWrite(pin12, LOW);

I want to loop this 400 times rather than having it all written out 400 times like I have It currently

any ideas? At the moment my sketch is 1037 lines long

for(int i=0;i<400;i++)
{
// insert your code here
}

BTW, 'delay' doesn't take 'float' parameters, so your 400 iterations won't last as long as you expect.

  delay(240000);

The delay function takes an unsigned long value as an argument. In the absence of any indications to the contrary, constants are interpreted as ints. 240000 is not an int.

If you really want to delay for 240 seconds, you need to specify the constant as 240000UL, to tell the compiler to treat the value as an unsigned ling rather than an int.