Automation question for smart switch

I’m just wondering if there is any way to set a blueprint or automation for a switch to have a 10 minute timer by default. But if you turn the switch on, off, on, off in 3 seconds it will bypass the 10 minute timer and just remain on until I turn it off? Thanks for any help.