Unfortunately, you can't prevent people from suing you, no matter how crazy the claim. What you can do, though, is prevent them from succeeding on their claims. However, there's being right, and there are the practicalities of the situation. If it would cost you more to hire an attorney than to pay the painter for what he says is owed, stop for a minute and think about whether you really want to fight him "on principle."
First step, though, is to at least consult with a litigation attorney to get clear on your defenses to the action (it sounds like you have a few) and to see whether there are any claims you might be able to bring against the painter.
Nina L. Kaufman is an award-winning business attorney, author and speaker. For more than 15 years, she has successfully navigated thousands of small businesses through the legal hurdles they face in starting and running their companies. Under her
AskTheBusinessLawyer.com brand, she reaches thousands of entrepreneurs and small business owners with her legal services, professional speaking, information products, and
LexAppeal weekly ezine.