MOSFET driven LED AVR blinker circuit exibits flakey behavior
You seem to have a confusion between the bitwise AND operator &amp; and the logic AND operator &amp;&amp;

For example this line in your code

if ( (PINB &amp;&amp; (1&lt;&lt;INPUT)) == 0 ) 


doesn't become true only when bit1 of portB becomes high but when any of the bits is high. That happens because (1&lt;&lt;INPUT) is >0 so is always true and that leaves the check on PINB, it will be true with 0x01 or 0x02 or 0x03... 0xff

The correct way to check the state of PB1 is  

if ( (PINB &amp; (1&lt;&lt;INPUT)) == 0 ) 


Another place you use the wrong operator is

MCUCR = MCUCR &amp;&amp; ~( (1&lt;&lt;SM1)|(1&lt;&lt;SM1) ) |  (1&lt;&lt;SM1)|(0&lt;&lt;SM1);


That results to either 0 or 1, what you should use is 

MCUCR = MCUCR &amp; ~( (1&lt;&lt;SM1)|(1&lt;&lt;SM1) ) |  (1&lt;&lt;SM1)|(0&lt;&lt;SM1);




Coming to your actual circuit, what is the need for 74LS14?
All you need is to enable the internal pull-up for PB1 and connect the opto transistor collector to the port pin to pull it down when active.

You can just wire it like



And as for the code, something like

// change the following clock frequency depending on the clock you use
#define F_CPU 9600000UL // 9.6 MHz`
#include &lt;avr/io.h&gt;
#include &lt;util/delay.h&gt;
#include &lt;avr/interrupt.h&gt;
//#include &lt;avr/cpufunc.h&gt;
#include &lt;avr/sleep.h&gt;

#define OUTPUTA 4
#define OUTPUTB 3
#define INPUT   1

volatile uint8_t  useless = 0;
volatile uint8_t  flashing_enable = 0;

ISR(INT0_vect)
{
    if((PINB &amp; (1 &lt;&lt; INPUT)) == 0)
    {
        flashing_enable = 1; // set flashing flag
        PORTB |= (1 &lt;&lt; OUTPUTA) | (1 &lt;&lt; OUTPUTB); // turn on both leds
    }
    else
    {
        flashing_enable = 0; // clear flashing flag
    }
}


int main(void)
{
    DDRB = 0x00 | (1 &lt;&lt; OUTPUTA) | (1 &lt;&lt; OUTPUTB);
    PORTB = (1 &lt;&lt; INPUT); // enable pullup
    // External Interrupt(s) initialization
    // INT0: On
    // INT0 Mode: Any change
    // Interrupt on any change on pins PCINT0-5: Off
    GIMSK = (1 &lt;&lt; INT0) | (0 &lt;&lt; PCIE);
    MCUCR = (0 &lt;&lt; ISC01) | (1 &lt;&lt; ISC00);
    GIFR = (1 &lt;&lt; INTF0) | (0 &lt;&lt; PCIF);
    GIFR = (0 &lt;&lt; INTF0) | (1 &lt;&lt; PCIF);
    sei();    // enable interrupts

    while(1)
    {
        if(flashing_enable)
        {
            _delay_ms(170);
            PORTB ^= (1 &lt;&lt; OUTPUTA);
        }
        else
        {
            PORTB &amp;= ~((1 &lt;&lt; OUTPUTA) | (1 &lt;&lt; OUTPUTB));
        }
    }
}


I have used single leds just to show the generic connection scheme. I have also omitted the capacitors, add them in your actual hardware.