That's not possible via scripting. There are only 2 global states of traffic lights and these states are returned by two internal functions. You have to hook these functions and make them return your wished value. Note that this requires some skills in reverse engineering and c++ and can't just be done by using a script function. This is how it can look in game - if you succeed:
http://www.imagebanana.com/view/emjigpb9/trafficlights.jpg I will not provide you with the full code nor give away any functions but if you have specific questions and make an effort, you can be sure I'll help you.