The only time I have witnessed chickens shaking their heads in that manner was in reaction to a rooster crowing within very close vicinity. I always interpreted it to mean that they found the noise irritating and objectionable. Interesting question though.