Foreclosure of a tax lien property is never a good experience to deal with. It is crucial to be aware of where you stand once your property has been foreclosed by the government or lender. And once the proceedings are put in place, you are going to have a limited time catching up on your mortgage payments.
Do this prior to the lender accelerating the payments, and to the point where they would accept nothing less than full payment for the property. If you intend to keep the property, the allotted time provided for this would vary depending on the loan provider. It would usually be no more than a couple of months.