As has been previously stated your stopping interrupt code for a VERY long time in the world of a 16Mhz microcontroller. I can see no reason to detach or stop interrupts during calculations of RPM in the main loop as the counter incremented by the ISR (rpmcount) is a byte value so should be written/read in a single instruction (thus no conflict between ISR and main loop using it)