Just found Peter Dunn's answer on another topic heading.
Assuming you were formed under Title 23 the answer, to me, is easy. By all means follow the Title 23 statute as to timing and record a Notice of Claim at your Registry of Deeds. Do this as soon as possible. Presumably there will be a party to the foreclosure, such as a bank, who owns the mortgage. Make sure that party, any involved attorney and any involved real estate agency gets a copy of the Notice of Claim. There may be an attempt to "throw out" or ignore your Notice of Claim but don't forget, or let them forget, that the Unpaid Balance follows the land. It may take several months or even a year or two but eventually your association should be paid the balance. Be sure to continue billing each billing period (say each year) and add this to the unpaid balance. Don't forget to include interest and certified mailing costs at settlement time which will likely occur at "closing" when and if the property sells and passes to a new owner. I have followed this procedure on four different property foreclosures and have recovered every penny owed. It takes courage to stay with it.
I have not been involved in any Title 13-b collection action which I am told would require Small Claims Court procedures and apparently an attorney.
P. Dunn