You could connect a standard relay to a motor port.
Dual-relay versions specifically for LEGO are available - http://www.techno-stuff.com/relay.htm
and - http://www.mindsensors.com/index.php?mo ... AGE_id=140
Latter advertised as a relay control but it is actually an electronic relay. Both models connect one set of 'contacts' with a 'motor forward' and the other with a 'motor reverse' signal.
Alternatively, you could use a 'latching relay'. These switch on with one power pulse and off with another. One type uses successive +ve pulses whereas another switches on with a +ve pulse and off with a -ve pulse. You could run two of the first type from one motor port using diodes to separate the voltage direction. Both have the advantage of not requiring power all the time.
All of these could also be driven from a sensor port using a PCF8574 - http://www.futurlec.com/Mini_PCF8574.shtml