Many options to do this... One would be to use a trigger node and the trafic light:
[{"id":"5ba9f88.9c32408","type":"trigger","z":"4b860295.c5a50c","name":"","op1":"on","op2":"off","op1type":"str","op2type":"str","duration":"3","extend":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":620,"y":2320,"wires":[["f13d1f61.f5fd3"]]},{"id":"f13d1f61.f5fd3","type":"traffic","z":"4b860295.c5a50c","name":"Trafic","property_allow":"payload","filter_allow":"on","ignore_case_allow":false,"negate_allow":false,"send_allow":false,"property_stop":"payload","filter_stop":"off","ignore_case_stop":false,"negate_stop":false,"send_stop":false,"default_start":false,"differ":false,"x":750,"y":2360,"wires":[["85c12147.1443d"]]},{"id":"f34afbbf.8c0288","type":"inject","z":"4b860295.c5a50c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":460,"y":2360,"wires":[["5ba9f88.9c32408","f13d1f61.f5fd3"]]},{"id":"85c12147.1443d","type":"debug","z":"4b860295.c5a50c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":910,"y":2360,"wires":[]}]
The first message put the trafic light to green and arm the trigger.
If a second message is received within three seconds the trafic light being green it goes through. The trigger put it back to red after 3 seconds.
GV