A very odd sentence. Probably grammatically correct, nevertheless it doesn't sound right to me. Both cases are possible, but I'd use different verb forms: either швыряли гнилые яйца, or швырялиcь...