Don't change entity angles more than once per frame. This could otherwise cause problems with intermediate rotations because Euler angles are internally converted to a rotation matrix resp. a quaternion.
http://manual.3dgamestudio.net/aentity-pan.htmExactly that happened in your sample project. ang_for_bone updates the entity rotation which you've set to 0. Setting it to a different angle afterwards had then no effect.