I'd suggest that you use a logic like this....to operate the motor switches from the X Y inputs and let the "autonomous" routine take care of itself.
NOTE:- I haven't bothered to check if the < > are matched correctly to the motor directions
if JoyY > 10 .... forward .............( 10 used as an arbitrary "deadband")
if JoyY < -10 ..... backward
if JoyX > 10 ..... turnright
if JoyX < -10 ..... turnleft
else ... motorwiper() ("autonomous" routine ?)
add in button press logic to suit yourself.... ON/OFF ...Joystick input only .. etc
http://arduino.cc/en/Reference/Return ...you seem to be using them without need.