You may end up having to pay for the extra 10 days you were there. Even though you were painting, the judge will likely determine that you would have had to pay for shelter somewhere, so I don't know you can get out of that. If the landlord specifically told you you didn't have to pay rent for that time, then that may be a different story. But if you charge him for the materials and time you spent painting, you can probably make that money back.
Right now, you need to send your landlord a letter telling him you are disputing EVERY SINGLE THING he tells you that you owe him for. You are REQUIRED to send him this letter within 15 days of receiving notice of what he is withholding or you CANNOT sue to recover anything. The statutes are very specific about this. Send the letter certified mail, return receipt requested.
Before you can sue him, you have to wait until your claim is ripe. To make your claim ripe, you need to wait at least 15 days after you send the letter to file your claim. That is because you have to give him a chance to return your money to you. If he does not, them you can sue.
You would go to your local courthouse to file. You will want to talk to the small claims division. You can call the courthouse and ask if they have the forms available online--I am not sure about that since every jurisdiction is different. Most of them don't have online forms, but you may get lucky!