Once you have the maximimum amount refunded to you, dump this beat-to-hell car back on the dealership and let them deal with disposing of it. It's their obligation.
Then go back out into the market and find yourself a clean, low-mileage car. inspect it very, very carefully. And CarFax any of the candidates that pass your intial inspection. In addition to that, I've kept my searches limited to owners that keep good records on the car. Chances are that if they put the effort into documenting the maintenance and repairs, they've treated the car well.
You're lucky to have the ability to file a claim against this dealer. Had this been a private party sale, you might have been stuck with this heap. So take this in stride as a learning experience and move on.