Hello,
as now said multiple times, GetActiveDocument() must not be used, but GetDocument() instead.
What is the point of your In/Exclude list? Are these the objects you "rotate along the timeline"?
This is typically not how a ObjectData object works; it generates objects based on its child objects or deforms objects in its hierarchy. It is not supposed to move arbitrary other objects.
As mentioned above, a tag plugin may be the better solution. The "look_at_camera" example show such a plugin rotating its host object.
best wishes,
Sebastian