May I assume the bank mortgage is prior to your lien? Presumably, if the value of the property exceeds the amount owed to the bank, and any other lien holders who are ahead of you (like the irs) your lien would still have value.
You should consider retaining counsel.
My answer is for general purposes only and is not not intended to establish an attorney-client relationship, nor is it advice upon which you should act or rely. But, if you really want me to tell you something upon which you can actually rely: don't eat yellow snow.
it all depends on the value of the property as compared to the mortgage on the property. If the Bank forecloses and sells it but the mortgage they hold exceeds the sales proceeds then your mechanics lien is worthless because the bank's loan is superior to your lien. You would only get paid if the sales proceeds were in excess of the mortgage.
My answer is not intended to be giving legal advice and this topic can be a complex area where the advice of a licensed attorney in your State should be obtained.
You mention that the bank is "taking over" the property. This can happen in 2 different ways, first, the owner can give the bank the property by a "deed-in-lieu of foreclosure" or if the bank has foreclosed, by buying the property at sheriff's sale. If the property is deeded to the bank by a deed-in-lieu (they have to accept it to actually stop the lawsuit), your lien might have just gained value because the bank is now the owner and the mortgage they had merged with the ownership interest. Alternatively, if it was sold at foreclosure, it is a simple process, although one the junior lien claimants (the ones behind the bank and the tax man) usually lose. There, the property is sole for a sum certain. The liens are paid off in full in the order of their priority (whoever's lien is first is paid first, if there is any money left, the next lien holder is paid, and so on until there is no more money). If your lien is in the list AND you participated in the lawsuit where the mortgage on the property was foreclosed, the court will determine if you are getting any money. There is one other, unlikely possibility, the lawsuit was filed, your lien was in place and they missed it. That is a VERY good thing for you as the property will likely be sold subject to your lien and you will be in first position. That almost NEVER happens. In my 28-year career of doing this, I have only seen it happen once to a client of mine.
If you are not familiar with the process, this is worth hiring a attorney just to look at the status of title in relation to your lien.
IF YOU FOUND THIS ANSWER HELPFUL PLEASE MARK IT SO.
The answers provided by R. Russell O’Rourke, Attorney-at-Law as a free informational service only. Without thoroughly reviewing your case neither I nor any other attorney can give you a complete answer upon which you could or should rely. Your reading of this or any of my answers does not create an attorney client relationship between us. Legal cases are often very fact specific and need a qualified attorney to properly review ALL of your materials and fully discuss your case with you before you decide the right course of action to take. YOU SHOULD CONSULT WITH AN ATTORNEY IN PERSON who has specific expertise in the area of law you are asking about.