Simple way to wire a stoplight
Funnily enough, I was just making a stoplight myself.

I found a microcontroller (see: arduino for a cheap, premade dev-platform) with a triac for each light to be the cheapest, simplest way to achieve what you want. 

A triac is a bit like a diode switch that is able of switching mains voltage, and when coupled with an optical isolator, can be driven (safely) by low-level logic voltage (from a microcontroller, ttl, or anything else you like). They cost about 99 cents each (plus $2.15 for a typical optoisolator) so its a very cheap solution. Here is a prototypical TRIAC control circuit, you could require additional capacitors/resistors depending on load type and the characteristics of the particular triac, so see their datasheets. The input resistor is set at the right value for the diode inside the optoisolator to receive the correct current from your logic source


The more expensive solution is to use a solid-state relay, which will accomplish approximately the same thing for a bit more.