Do you have any suggestions as to how I could improve my code?
As I said: use micros() instead of millis(), then you could calculate the RPM at each pass because you have an increased precision by about a factor of 100. You also don't have to count the passes, just store the difference between the last two interrupts in microseconds and do the calculation in the loop when you request the RPM value. This way you keep the ISR short and fast but keep a high precision. If you also want a high accuracy, use an Arduino with a crystal, not a resonator.