I can pretty much guarantee you that your code is not being skipped. Instead you need to ask yourself why it might seem like it's getting skipped. The only reason would be that the delay in your function isn't doing what you think it is:
while(pos<theta) delay(1);
Note that you initialize pos to zero, and then call a function that only delays if pos is less than -360 (which is immediately false). This will cause your function to immediately exit and proceed to one that drives the motors in the other direction until pos is greater than 360 (in this direction the while loop is not true immediately and you actually get a delay). When you switch directions you need to switch the less-than operator to a greater-than operator.
Note that you initialize pos to zero, and then call a function that only delays if pos is less than -360 (which is immediately false). This will cause your function to immediately exit and proceed to one that drives the motors in the other direction until pos is greater than 360 (in this direction the while loop is not true immediately and you actually get a delay). When you switch directions you need to switch the less-than operator to a greater-than operator.
I'm so sorry it was such a stupid mistake!
Thanks so much for your help!