Sketch for Stepper motor??

i'm getting hung up on my delay function

Right now - forget that delay() exists. You NEVER need to use it. There are alternatives that are far better.

do I need to use a variable to store the value of the "pirpin"?

Yes. Two actually. One to save the current state and one to save the previous state.

Then, you do stuff only when the current state is not the same as the previous state. What is does (step forward or step backward) depends on the current state.