You might be able to use something like the streetlight addon and modify it a bit.
Make a basic model of a traffic light, and a bit of scripting to change which colour light is on.
A few changing textures so you can see what light is on during day time (I have no idea how to actually do this), and presto....a working traffic light.
Or if your really lucky someone might have already made one.