This reminds me to take a look at our water heater manual for maintenance info. I used to flush out our old one every couple of years because our well is an old bored shallow well and with heavy water usage starts to suck silt. I should probably have thought about a filter already but that ship has sailed, we've been here 25 years and where it would need to go is a pain to access.
We replaced our electric water heater 6 years ago after a leak that caused damage, requiring restoration. What a pain, but we did get a "freshen-up" on parts of the house, floors, etc.. The leak wasn't the water tank, it was a brass Quest fitting behind the wall that leaked. We knew we had quest tubing, it was part of a class action suit we got nothing from and had to sign that we knew it was there. It's not the plastic, its the brass that goes. I had a plumber (I'll use that term loosely after that nightmare) remove the Quest and replace all our lines with PEX.
I would say, other than maintenance like other have said, it depends on where the unit is. Ours is upstairs in a 2 story house. If it leaks, its a real problem. If yours is in a basement or crawl space situation there may be less damage from a leak. Otherwise if you have the money, nothing wrong with replacing it.
I have a weather station with remote sensors that report back to a main display. There are water detecting senors available for it. I have one of those both upstairs in the hall right next to the laundry closet where the water heater is, with the water sensor cable fed through the space the bi-fold door leaves. I have another in my crawl space where I have a dehu that runs as needed to control that. I have that water sensor in a low area (crawl space floor has been plastic sealed, etc.) that water leaking from the dehu will collect and trigger the alarm.
Those sensors work! I DID get a false alarm one night at the water heater, but my dehu froze up and started overflowing the pan. The sound was so annoying I could not, not address it right away. Of course it was 3AM, and there I am out there getting under the house. I could have just unplugged the weather station but I had no idea what I was facing down there and had to see.