It looks like a simple follow throught animation. You can achieve this result with parenting and without scripts but I think one of the most used is Motion v3 by Mtmograph. I think it has a module called Excite that add an expression to create an oscillation for the movement of your layers. Maybe other people can recommend any other tools to do this.
As Jose said - you can achieve that without any scripts, but if you need - Motion 3 Excite can be the way to go, you can also try any other folow tthrough/overlap animation, or you can try some of Anthony Possobon 's free scripts and advanced tutorials on environemen movement f.eg: