interrupt question

Dennild:
from what i can understand from this code it runs the function pin_ISR() when ever the button is pressed. but what does it do after that? does it start over from the top of the main loop or how does it continue?

Your loop function is interrupted by the ISR. When the ISR terminates, the loop resumes doing whatever it was doing at the time.

So, if your loop is printing the values 1-1000 and the ISR gets triggered just as it is about to call Serial.print(67), the ISR runs, returns, and then the loop continues on and prints 67.

From the loop()'s point of view, the ISR calls happen invisibly and can happen at any time. You use volatile variables (usually) to communicate between the two.