Scripting Build Modifier Cycle / loop

I am struggling to find a way cycle the Build Modifier. I have tried to make it work with the F curves and the NLA but without success. The Build modifier is controlled by the timeline frame number and the length of the effect. When I cycle the keyframes in the fcurves, it cycles the start frame so when the timeline bar has past the keyframe once, the cycle goes backward whilst the timeline bar continues forward. The same happens for the NLA. The only solution is the video editor but that is not very practical.
I was hoping that somebody would have a smart formula to be able modify the start and length so that looping can occur.

Many thanks

I have managed to find a solution of sorts using the Anmation Nodes addon.
Below is the animation node setup to change the Build modifier Length value. I use the timeline frame number as a seed value and then use some maths to drive the modifier value. I am no good at maths so I am sure that the is a better way of doing the maths but the result is that I can ping pong the modifier values.
More interestingly, if you hover over any modifier value box, the help gives the command line needed for the Animation node. Thanks to O.G. for showing me and Jacques Lucke for creating this amazing plugin