Bezier Curves

I have to dynamically animate some bezier curves that have to look like this.
Here is the archive of my approach and i’m not sure is the best one.
I mean it kind of eats the whole processor. Does anyone know of any better way to do this ? :stare: