I have read about shaking of the head (if I remember correctly) a type of worm. I will try to look it up.
OK, I am not sure if this is what your hen has but the worm I was referring to is Gape worm. They shake their heads in an attempt to expel the worm which gets caught in the air passages...