Hi, I would start by looking up circuits for a retriggerable monostable using a 555 timer or a 74LS123. You could then use the output to drive a relay coil (via a transistor/darlington). You will need some kind of protection on the input as well (resistor/4v7 zener, or opto coupler). You can configure the output pulse length to be longer than the input period so that your output will remain stable (I would probably go for somewhere around 1 second).
Hope that the ideas help.