LotekK's idea is probably your only option, perhaps if you can script a ray trace you can check for shadow occlusion as well. TO be honest this thing is something you would most probably just keyframe manually. But it's a cool exercise.
Id say if you ever did script it, you'd want to do it over time as well. Just making the iris close or dilate based on light would mean it was instantly the right size. You'd want it to be lit/in shadow and over a half-second or so to close/open as it adjusts to the light.