" but some of those (knock sensors) come back immedeatly after startup, so driving a while in limp mode or just restarting immedeatly will fix it by luck (my experience)"
That has been my experience. Twice the car has gone into limp mode & a restart has cleared the error. This time it's become a permanent limp !
The problem with sensors throwing codes and 'limp home' is that mostly the codes that show an engine warning 'only' are emissions codes which are set after the ECU detects an error condition for a pre-set number of cycles (pending error code) - so resetting the code or battery disconnect will work and give you back the number of cycles before you need to reset again (it doesn't fix the faulty sensor).
Some newer programming only allows a certain number of 'resets' before throwing a permanent code which would be a dealer reset (I hate those).
Are there recommended replacement cycles for sensors - mostly no - they are designed to last the 'lifetime of the vehicle' - question is what is that 'lifetime'?
In general the 'lifetime' of the vehicle is considered by manufacturers as the period of their guarantee so a guarantee of 50,000 miles or 3 years means that is what you can reasonably expect all parts to perform against!
Do sensors age? yes they do, particularly those in 'hot places' - general advice would be to put away a small amount of the obligatory 'spares and repairs' budget for sensor replacements - if they are easy to get at then fix on failure, if they aren't then be prepared to replace when opportunity arises.
Also as a caution - don't always assume that the sensor has failed - it may be doing its job perfectly and detecting a fault - a faulty MAF or MAP could give knock conditions - so don't blame the knock sensor - simple OBD readers report codes, dealer set ups report the sensor parameters so easier to spot the good or bad sensors!
I loved my first car - a 1966 Ford Galaxie - it had almost nothing electric onboard just a stuffing great 7L V8, wires to and from the battery and alternator, ignition / coil wires - nothing else. How times have changed :-(
ps I don't miss the 8 track cartridge player!