Small circuit to control car brake lights does not work 100%, need help

Recently, my friend asked me to build him a circuit to flash his brake lights twice quickly, then stay on, each time he hits the brake pedal. Originally, he said the flashes should be on and off for about half a second, but he was modeling his desires off the brake lights on a fire truck and his measurement of time is terrible. In actuality, he wants them to flash around 20-50ms each. I threw together a circuit on a breadboard, using a switch to emulate the brake pedal and an LED to emulate his brake lights. Originally, I also tried to design it under the presumption that the lights should flash at about 200ms or so, expecting that his original estimate was a little bit slow. I only have a hand drawn schematic of my circuit, and no way to scan it, so I will try to explain it as best as possible. His brakes are active low, so I have the switch grounded, with the other side connected to the trigger of a 555 configured as a monostable pulse with a duration of about 50ms. The trigger is usually held high by a 10k resistor. The output of the 555 is connected to a voltage divider that puts out about 6V, which is fed to the gate of a 2n7000 NMOS. The drain is at 5V, and the source is grounded through a 1k resistor. The output is taken off the source, and connected to the arduino pins 2 and 3 for interrupts. (I know I could have used only 1 interrupt that triggered on change, but I am not experienced enough with programming these and felt more comfortable using two seperate interrupts). I checked the voltage on the input when the switch was open and closed, and the levels are .03V and 4.8V. The output from the arduino is taken from pin 12, through a 10k resistor, to the base of a 2n2222 BJT. The emitter is connected to ground, and the source is connected to pin 85 of a standard 30/40A automotive electromechanical relay. Pin 86 is connected to +12V, and a flyback diode is placed between the two. Pin 30 of the relay is connected to +12V and pin 87 is connected to the load, in this case my led with limiting resistor. This is my code:

int relay= 12;   //Output to relay
int time= 30;   //Time pulse is on or off
volatile boolean able = 0;

void pulse(){
  digitalWrite(relay,HIGH);
  delay(time);
  digitalWrite(relay,LOW);
  delay(time);
}

void rise(){
  able=1;
}

void fall(){
  able = 0;
}

void setup(){
  attachInterrupt(0,rise,RISING);
  attachInterrupt(1,fall,FALLING);
  pinMode(relay,OUTPUT);
}

void loop(){
  while(!able); //Do nothing while waiting for brake to be pressed
  
  pulse();pulse();           //Two Pulses
  digitalWrite(relay,HIGH);  //Then turn on
  
  while(able); //Wait while brake is still depressed
  
  digitalWrite(relay,LOW); //Turn off relay once brake is released
}

When I tested it with time=200, it worked perfectly every time I tried it, probably upwards of 100 times. However, when I brought it down under 50ms, sometimes when i pressed the switch, it would flash twice at 50ms, then come on for probably a few microseconds, and shut off, even though the switch was still depressed. If this were installed in a car, this would amount to the brake lights being off even though the brakes are depressed. Needless to say, this is an unacceptable condition. I don't have a scope to check out the voltage levels on the interrupt inputs, but I am guessing that for some reason the level is dropping for just long enough to trigger the falling interrupt that results in the relay turning off. Does anyone know of any hardware or software modifications I can make to remedy this situation? Any help would be greatly appreciated

Try drawing it up using powerpoint, make some symbols & just copy them as needed. Attach that to your message.

Ditch the 555 and just drive the transistors on/off directly via the arduino in whatever sequence you are after. Simplify.

Or download the schematic software from expresspcb and draw one up there, is very easy to use.
shift+printscreen to capture it, paste into powerpoint, save-as type .jpg and attach to your message.

I threw together a schematic in LTSpice. It's a little messy but I think it gets the point across. The purpose of the 555 is to act as a simple switch debounce circuit. I don't really know whether the brake line fluctuates a lot when its engaged but I figured it was better to be safe than sorry, and I figured a 50ms pulse would outlast any switch bounce there may be. The NMOS is there to try and prevent anything greater than 5.5V from ever reaching the input of the Arduino, and the BJT is there to engage the relay, because it will not trigger for anything less than about 5.6 volts. I know simple is usually better, but I couldn't think of anything simpler while still being fairly reliable in an automotive environment.

Less parts is more reliable than more parts.
The arduino can handle debouncing the switch for you.
Have the brake switch drive an open collector/open drain transistor to pull the arduino trigger low if you'd like for some seperation (or use an optocoupler)(with the reset pin's internal pullup providing the high), let the software take it from there to drive the NPN & Relay.

Okay. How would I go about debouncing with the arduino, and subsequently triggering the interrupts based on that? I am still learning how to program so I'm a bit lost

Set up a blink without delay loop, once a millisecond check where you are.
Set some flags to indicate the brake was pressed and that your timing sequence started.
If started, then start your relay sequence and every 1 mS (or 5 or 10 or whatever)
you check the elapsed time and see if you're ready to move on to the next state (flash on, flash off, steady on).
Once 25 or 50mS have elapsed (unless your friend is a drummer and has a really quick foot and a snap action brake pedal), start reading the brake switch again to see if its been released and if the sequence should be aborted, then go back to reading it to wait for the next press.

Alternately, you can try this scheduling software.