I believe velocityAtTime() is a property to be accessed in this manner:
myLayer.position.velocityAtTime();
i.e. you want to pick whip your layer for the beginning part and add .position (if you want the velocity of the change in position, rather than change in rotation, or scale) and then the rest of the code in that line.
I didn’t investigate the full code, but that should at least address the error message.
Kalleheikki Kannisto
Senior Graphic Designer