You got lucky with the timing of the first battery failure. That should have been the lesson.
The second battery failure happens and you’re wondering whether you should go for a third?
When a battery replacement costs more than than 100% of what the vehicle is worth, it’s time to dump it.
The real lesson is; never own a Tesla outside the warranty period.
To simplify the math:
If I bought the car at $100,000 and sell it now (while it still functions, not when it's dead), it's worth $20,000. I can buy another new one, and my net loss is $80,000.
With that $80,000, I could drive another 8 years or 100,000 miles (simplify the math, not the actual number). Thus, each year costs $10,000.
Instead of buying a new car, I would buy a new battery that costs $20,000 (simplify the math, not the actual number) for 4 years and 50,000 miles (parts warranty). Thus, each year costs $5,000. I don't have to find a significant sum of $80,000 to pay for the new $100,000 car.
The battery might outlast the parts warranty of 4 years and 50,000 miles.
So there's a slight advantage in paying for the expensive battery and keeping your old car.