There are a few expressions related to angles:
angle(x1, y1, x2, y2) Calculate angle between two points
anglelerp(a, b, x) Linearly interpolate the angle a to b by x. Unlike the standard lerp, this takes in to account the cyclical nature of angles.
anglediff(a1, a2) Return the smallest difference between two angles
anglerotate(start, end, step) Rotate angle start towards end by the angle step, all in degrees. If start is less than step degrees away from end, it returns end.
You're probably looking for anglediff, although you should know that it always returns positive result. I.e. anglediff(10,50) returns 40, and anglediff(50,10) also returns 40 (not -40).
Also these system events may be useful: "Is between angles", "Is within angle", "Is clockwise from"