You only need a real estate attorney if you actually proceed with the foreclosure.
Otherwise its pretty black and white.
If you foreclose as a junior lien holder then you get to be the owner subject to the senior lien (with all the incumbent payments and duties).
Unless the property is more valuable than the liens that are senior to your interest as an HOA (eg: it is worth 500 and the 1st and 2nd are for 300) this is a colossally dumb move.
This is why most junior lien holders (be they 2nd’s, 3rd’s, HOA’s, or contractors) don’t foreclose on properties.
They just hold onto that lien interest and wait until the asset outweighs the liabilities.
A better move would be to find out (using public records or private databases) whether or not there is a foreclosure action going on.
If there is one, you are better served to pile on a heap of fines and assessments after the bank repos it.
This would not necessarily stand up in front of a lawyer.
In fact, it almost certainly would not.
However it is also almost certain that the bank (with all the places they are collecting) won’t notice that some of the assessments and fines predate their ownership.
Many banks delay repossession simply to defer those fines.
At any rate, if they contest them and you realize your “mistake”, there will be no additional negative consequence other than being unable to collect them.
As you can tell my sympathy for the banks is rather limited (and I live in a conversion where they have really screwed the HOA).