Sorry for the lack of info.
I'm trying to make one entity rotate to face another one.
function is_ReturnAngleForTurningToEntity should calculate the pan difference required to face the target.
FUNCTION rotate_entity does the trick, but needs to be constantly updated.
So the action uses a while loop to keep the entity turning till it faces it's target.