@bludin
About the only way I can think to do it in software is a bit convoluted.
EDIT: on second thought no need for half these steps
1: Use M571 to control an output pin . There doesn't need to be anything connected to it. relay or mosfet module
2: Connect to output of the relay to a GPIO pin
3: Create a trigger.g file for both rising & falling trigger events to update a couple of global variables with the led state required and current time.
4: Monitor the output pin in daemon.g to turn the led on and off when the sate is off and the current time > set time plus delay
Monitor the output in daemon.g.
Turn on the led if it's high and also set the stop time to "now + 5 seconds"
If it's low and current time is > stop time, turn off LED
You'd need to do the whole lot in a while loop if you need timing less than 10 seconds as that's the default cycle time for daemon.g