Could you consider something like this :
#look at mouse
# do something with the node rotation
if(global_rotation_degrees < 0):
flip_v = true
flip_v = false
look_at function rotates the node to the mouse so I dont think we need to calculate it again just look at the mouse first then you can do whatever you want with the rotation variable.