Well your code is doing exactly what you tell it to. Problem is you are not specifying the right thing. There is no path through your loop() where the motor will not turn. So instead write it so that you don't use the 'else' part but put another test for that section for when you want the motor to move in the other direction.
Have a look at this thread:- http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1243450963