flash warning when off the road

How can I write the script for my application to flash a warning, when my rigidbody leaves the road i.e. gets on the grass ?

The question http://unity3d.qatohost.com/questions/162301/wrong-way-racing.html has some ideas for how to tell if you leave the road made up of waypoints.