How to force repeated animation in code?

Did you ever figure this out? I’m also looking for a way to repeat animations.