Blender drivers work differently on frame stepping than frame selecting
Well I found a very easy solution to the problem.

I use an empty proxy object to drive the rotation and location of my edge.



So I copy this z rotation with a simple driver, and my original script gets the z rotation input from this proxy. Now it works perfectly regardless of the interpolation.

It is important to note: That the one frame latency occurred, because in the question the driver and driven properties belonged to the same object. In a case when these porps reside on different object it should not occur.

I experimented further this issue, and the problem also shows itself if two objects mutually drive themselves.