steppermotor only few steps

Pseudo code

if (button becomes pressed)
  change state of boolean variable
  if boolean variable is true
    move 200 steps in one direction
  end if
  else
    move 200 steps in opposite direction
  end else
end if

It would be convenient to write a function to move 200 steps and for it to take a parameter that indicates which direction in which to move.