How can I run a script when the room brightness has changed?
Lilt will do this.

http://www.jonn8.com/lilt/

I used to use it to change my desktop picture from a light to dark one  when the ambient light changed :D