If it's a sign of other looming problems, it's time to look for replacement.
If it's relatively isolated or "Just a think that happens with this model" that can be permanently fixed (head gaskets are notorious for failing multiple times because the gasket failure is due to the engine's head warping), fix it and move on.
Look at what you've deemed your willing-to-swallow deprecation rate is per mile. If you think this repair will make the car last at least as long as the cost divided by that depreciation rate, you win. If your car is "fully depreciated" in your mind, and you accept 5 cents/mile of depreciation, a $500 repair for example is acceptable if it means it will keep the car going at least another 10,000 miles. I would say "cost to repair vs. value of car when repaired" on its own is honestly not a great gauge unless you're already going to sell it tomorrow.
I would disagree that if you can do a timing belt, you can do a head gasket. Even on a very simple car (a friend's junky '95 Geo Metro), it was a lot more work to do a head gasket vs a timing belt. And I didn't 100% trust my work after I was done. Car ran, and without blowing a hilariously large cloud of white smoke into the neighbor's yard, but I still wouldn't have trusted it. I'm not saying it can't be done, but it's definitely more work than a timing belt.