You're basically asking, "How much can I lie, cheat, and steal, without suffering consequences?" (this link directly answers the first half of your post)
It's not a good question to ask.
Regardless of whether your goal is making great games or making money, you should instead ask: "How can I make *my own* game, that is better than and greatly improves upon Paper Mario?"
As a general rule of thumb, you can use the ideas in games, but not the fine details. (this isn't legally true, but it is generally true as a matter of practice - most games borrow heavily from each other in ways that other industries don't tolerate).
As a better rule of thumb, analyze your motives and think it through: if you are trying to capitalize off of Mario's fame and popularity, rather than merely like an idea or two in a Mario game, then you are trying to cheat to make your game popular, rather than making a good game that deserves to be popular. You're not only cheating Nintendo, but you are also cheating consumers.
Whether or not you release your game for free doesn't give you protection. If you are trying to capitalize off Nintendo's property for your own personal gain; whether it be building a fanbase, or praise and pats on the back from the community, or to promote your next game, you are exploiting Nintendo's work to give yourself a cheating boost or good feelings, and it hurts Nintendo (short-term) and the public (long-term), so the court system will not look kindly on you and you can be fined money even if you made zero money, because you potentially cost Nintendo money (theoretically) or damaged their brand, and you benefited in non-money ways (the praise of people, and increased fan base, for example).
On the other hand, if you like some of the ideas in Paper Mario (camera angle or a few mechanics, for example), and make an awesome Paper Mario-esqe game, and players don't even realize it's inspired by Paper Mario, then you're almost certainly in the clear (again, not necessarily legally, but by standard behavior of the industry at large).
I've also considered making Paper Mario-esqe games (they are great games), and have zero fear of getting sued, because I'm not trying to use the popularity of Paper Mario to artificially boost my sales or fanbase, but would merely be using some of the ideas to make my own different game.
To answer the second half of your question, after Nintendo sues you to smithereens for intentionally, openly, and knowingly using their IP for your profit (financial or otherwise), yes, you can simply remove all the parts that were infringing and re-release it, assuming you didn't lose the rights to your own half of the work when settling the lawsuit.
Spryfox vs 6waves is interesting in that regard. 6waves cloned Spryfox's game Triple Town, and made a game called YetiTown, so Spryfox took them to court, and when it was apparent that Spryfox was going to win, 6waves cut a deal with Spryfox giving Spryfox ownership of the 6wave's cloned version (likely in addition to a huge amount of money, but the details are secret).
"As several news outlets have discovered, we have amicably settled our lawsuit with 6waves. We are very happy with the outcome and glad to be finished with this matter. The full terms of the settlement are confidential, but I can disclose that as a consequence of the settlement, ownership of the Yeti Town IP has been transferred to Spry Fox." - Founder of Spry Fox