Be very, very careful what you do and take care not to do anything until you understand precisely what the statutes and case law for your state says.
If there is already a personal representative (executor or administrator), then there may be a formal process that must be used to name and serve the successor to the decedent in order to obtain jurisdiction over the representative. If the representative appears in court and files anything, this is probably an appearance which will give the court jurisdiction over the administrator, etc.
The same is true if there is no administration in respect of heirs. If an heir files something, then that court will have jurisdiction over the heir.
Filing an administration or obtaining letters testamentary might also in some places be the very worst thing to do. For example, in some states, if there is no administration, then the plaintiff might need to name and serve ALL THE HEIRS. If you file an administration, then they will ONLY need to name and serve the administrator!
Similarly, if you rush to the plaintiff and TELL THE PLAINTIFF that the defendant has died, then they will begin working right away to move things forward by naming and serving the heirs. By contrast, if you play your cards closer to your vest, then they will not know of the death and will not necessarily know the identity of the heirs. Of course, a published obituary can give them a clear roadmap.
If they cannot find the heirs to serve them as substitute defendants, then the suit might not be able to proceed.
Still, it may be necessary for someone to file SOMETHING with the Court in order to put the Court and the plaintiff on notice of the death. UNLESS there is a specific pending docket deadline, it might be better to file nothing. PREPARE a notice -- a suggestion of death -- to be filed by someone OTHER THAN AN HEIR. For example, if the decendent died with a wife and children these are likely to be heirs, etc. By contrast, a brother, uncle, cousin, etc., is unlikely to be an heir unless there aren't other closer relatives. Of course, someone can be a legatee without being a relative.
Suppose that John SMITH dies leaving a widow and four children. Brother Joseph SMITH is not a legatee and hasn't been named as executor or administrator. Joseph SMITH could wait until the eve of a hearing and then file a suggestion of death, attaching a copy of the death certificate, but otherwise not identifying himself as to relationship. The suggestion of death will usually bring things to a halt.
The foreclosure mill law firm will then try to identify the heirs. Let them find and serve all the heirs. Then file the will or an application for probate. When an administrator is appointed, they will then need to substitute in the adminsitrator and serve him or her.
Talk to an attorney! Make sure it is a really capable probate attorney. Get some good advice first. But if you engage and pay the lawyer, then he is going to want to run in and file for probate right away because that will lock you in. Once that attorney has filed for probate and entered an appearance for you, then you are going to be liable to pay the attorney.
It is very important to bear in mind that foreclosure laws and civil rules vary. Probate law varies. The same answer may not apply everywhere.
One advantage you now have is the foreclosure mills really do not know probate law. So they are going to sit back and hope that you make a mistake by rushing in and filing things that will give them jurisdiction.