If the property was foreclosed on and title is now in the name of another party you will need to leave, lawsuit or not. Yes they say possession is 9/10's the law but in the case of a home possession mean the title not occupancy. Be careful some day a sheriff or marshal of the court will show up change the locks or remove your property then you will be chasing after that.
Your lawsuit for unlawful foreclosure if by a slim chance you win would net you compensation not the home. If you miss one payment you are in default of a mortgage so over turning even the most botched up case is difficult.
We have about 24 cases in this same situation, some were able to drag out eviction because law enforcement was sympathetic but eventually they were forced out.
Buy a home after foreclosure expert
Helping families/people that have lost their homes get back into another in as little as 6 months.