This is wrong, but probably not causing your problem:
if (degree_prev-degree_now>=0) goal = degree_prev - degree_now;
else if (degree_prev-degree_now < 0)goal = degree_prev + 360 - abs(degree_now);
There are two problems: the second 'if' is redundant since it must be true if the first condition is false; if there had been any situation where both conditions were false then goal would not be set.
There's no obvious way for the code to get stuck so I suggest you need to look for non-obvious ways. To do that, add print statements before and after each function/method call in the loop and see whether execution is blocking somewhere. Add a delay(100) or similar after each print statement to allow time for the serial output to be sent, in case something is blocking with interrupts disabled, or crashing in a way that kills the serial output.
Aside from the issue of why the code is not executing, the logic associated with goal looks pretty dodgy. What's it intended to do?