Some of the worst-funded public pension plans in the country had too much money two decades ago, making them a cautionary tale for sticking to a methodical, strategic funding plan when times are flush.