The problem with the timer switches I've seen is, they can't be just flipped on and off, like an ordinary toggle switch.
This might be more difficult than I originally thought. If there are only two wires, i.e. no neutral, then the timer will have to be powered, using a capacitor, whilst the switch is on.
Here's a timer switch I designed awhile ago, for 12VDC. It will need to be heavily modified to work on 230VAC, which might not even be possible, due to the lack of parts, with sufficient voltage rating. It will have to be connected to a fullwave bridge rectifier. Tr1 will need to be changed for a part, rated to at least 400V, with a 470k resistor between the gate and source. The problem is Tr2: do 400V J-FETs exist?
https://www.eevblog.com/forum/projects/onoff-switch-with-timer/msg825310/I suppose the same principle, as the above could be used with an MCU, run off a micropower shunt regulator.
One problem with this topology is the leakage current will be high enough to cause an LED to glow very dimly, which might not be a bad thing.