Sine wave reading in... Interrupt pins not working?

I'm not familiar with this, but isn't pin 21 a signal line for the TWI? Maybe that is interfering with what you're trying to do.

You don't seem to be initialising the pin mode or pull-up status for any of your inputs/outputs. I think explicitly initialising all the pins you use would make things more obvious.

How clean is your input signal? Depending how it's connected up, you could easily be triggering off noise on the line, rather than a clean sin wave. Have you tried scoping it? (Many years ago I tried to use current ripple to detect speed on a DC motor - utterly hopeless because there was far too much noise!)