Damn did I get screwed, my own fault though

Well I wanted to replace my daily driver (Nissan p/u). Looking for something with a little more power to pull a small camper.

So about two weeks ago I picked up a 2005 Grand Cherokee from a small used car dealer.
First mistake was not taking to a jeep dealer for a pre purchase check. Second mistake was missing some existing problems when I was test driving / looking it over.

30 minutes after I bought it, I stopped to fill up the gas tank. When I restarted I had the window down and could hear the massive exhaust leak at the drivers side manifold. Didn't hear it during test drive with windows up and air on.
3 hours later on my way to work, I look down and the check engine light is on.

Next day I call the dealer, "sure bring it down and we'll check it out". Well, all I found out is that it has an exhaust manifold leak (which I already knew) and that the check engine light is on because the trans is throwing a code. (but it drives and shifts fine.) The dealer of course wont do anything to fix either of these problems, (used car, as is).

Next I find the moon roof refused to stop in the "closed" position, opens and sort of closes but you have to push the center button at exactly the right time to make it stop near a closed position. Read on the internet a little that if you put it in the open (raised at back) position and then hold the center button down for 5 seconds, and then cycle the thing open and closed a few times it will reset the brain so it knows where open and closed is. Well
what I ended up with after holding the center button for 5 seconds is that now it will not function at all ! Stuck in the open ( rear of the glass lifted up) position !

Its just been a freaking nightmare from day one and I'm so freaking pissed at myself for getting in a hurry and not properly checking it out, and pissed at the dealer for selling me a turd and refusing to do anything about it.

How many thousands of dollars will I be out before I can get all this crap fixed? I have no idea.