Programming AVR (ex attiny2313) using Arduino IDE and Arduino board

I gues that the voltage droped bellow 4.3 and attiny entered the sleep mode.

Not sleep mode. Reset. The processor resets when the BOD is triggered. And, if the processor was resetting...

Everything was working okay but sometimes the LEDS just froze.

...the LEDs would go out instead of "freezing".