If the bank forecloses and there is no money left over after the highest bidder obtains the property at a foreclosure auction, your lien will most likely be wiped out. This does not necessarily preclude you from taking him back to court and asking for your money through enforcement of your divorce judgment. Of course if the property sells prior to foreclosure, the title company will not close unless and until your lien is satisfied, so this will give you substantial negotiation power in a sale scenario. You would be well served to seek legal counsel immediately to preserve your rights.
This answer is based upon limited information provided by you, and is therefore generic legal advice and does not create an attorney-client relationship. You are advised to seek legal counsel for your particular situation.
A weekly guide with tips and legal advice for each stage of the process.