Your pupils bouncing around as you say, may have nothing to do with lighting in your room, but have to do with your eyes focusing. If your eyes are trying to focus the pupils will get bigger. So when you shine the light in your eye they get small due to the light, then they immediately get bigger when the light is removed, and then "adjust" to focus. Ever notice that when a cat is intent on looking at something their pupils will get bigger? No change of light in the room, just change of focus.