Is there any available schematic of it?
That's quite an ISR you have.... :( Usually it has to be kept as short as possible. I'll try having a look at this later.
Looking at the actual main loop... i'm not even sure if ANY interrupts are needed. Maybe just a read PORTA in a loop would do the job.