Usually it is normal for you to get dilated eyes when you are shocked or surprised. However sometimes the coming bacterium in the eyes could also make it dilated. You could use the eyes drops with anti-inflammation to stop them and make the eyes feel comfortable and better. You could also do the warm compress to make the eyes feel comfortable.
Are you sure that your eyes are not be dilated temporally? There are many situations that can lead to eye dilation. Such as fear or being attracted to someone. Generally, these reactions are small and the pupil will become slightly more dilated, and again it is only temporary. It usually corrects itself immediately. Drugs can also affect the dilation of the eye. Some illegal drugs also cause the eyes to dilate.
If your eyes are unnaturally dilated and do not respond to light, you should seek medical attention immediately. So if you eyes are not going back to normal, you'd better take care of it, because it may be something serious. Eye doctors can dilate eyes during an exam with eye drops. If you have had your eyes dilated for an exam, you must be careful when going outside. You should wear sunglasses outside until your eyes have returned to normal.
I suggest you to find out whether you eyes dilated temporally or not, if it happens often, you'd better go see the doc.
There are many causes that may fuel the dilation of the eyes, for example, the irritation of the either the cornea or the conjunctiva, protective coverings of the eye, can cause dilated pupils.
If no causes can be found, there are still ways to get rid of dilated pupils. Medications can be used to constrict the pupils. Phenyephedrine and pilocarpines, for instance, they are specifically for this purpose contain medications. Patients with glaucoma use these drops to constrict their pupils decreasing interocular pressure. Care must be taken with constricted pupils also. The dim light will protect the eye but it will make your vision difficult at night. What's more, you may always take care to use appropriate eye wear. Do not drive or operate machinery with impaired vision.