It's called getting into a rhythm and it does help in preparation of the shot. Players try to follow the same familiar routine of movements before shooting a free throw so that after a while the whole shot becomes second nature. Of course, for most players do not have exaggerated movements but almost every good shooter follows some sort of preparation routine that they repeat when they get to the charity stripe.