I'm leaning more towards trading it in can anyone give me some pointers on how to get the best deal?
Information is key to getting the best deal possible. That is why I would strongly suggest getting a second opinion on the repairs. A misfire could be caused by many things. From cheap (bad spark plugs or cables) to mid-range cost (timing is off) to expensive (not getting proper compression in the cylinders due to mechanical issues that could require an engine rebuild). Also, car diagnostics is not an exact science, so it is definitely worth checking with another mechanic. You trust the first place you took it too, which is great. You taking it to another place does not represent a lack of trust, it represents knowing that humans are fallible and car repair diagnostics are not perfect either.
Once you have quotes from 2 or 3 places for the repair work, you are in a much better position to negotiate.
The next step is to see how much it will cost to replace the thing. Get actual quotes for trade-in from dealers, and you must disclose the engine troubles to them when getting this quote. $8,000 minus this amount is how much you are under water. Add that to the price of the car you would like to purchase to know how much of a loan you will have to take out (minus any downpayment).
The next thing to consider is how you manage your risk from there. Your new car will be under-water too. Can you even get a loan? Will you need additional collateral or gap insurance to get the loan? What happens if you get in an accident the next day and total this car?
Once you have all of this information, you are ready to really start thinking about the decision to be made. Things to consider: How reliable has the HHR been up to now? You don't want to put $3,500 into it now only to have to spend a few grand more in a month to replace the transmission. It is hard for us to know this as we don't know how long you have had it, what troubles you have had in the past, how well you have taken care of it (regular oil changes and maintenance). Keshlam is right about asking mechanics to check for other problems and scheduled maintenance that has not been done (e.g., timing belts replaced).
Once you have made your decision, remember that everything is negotiable if you are wiling to walk away. If you decide to keep the car, try to get a better deal on the repairs by checking out other repair shops. If you decide to buy another car and get rid of this one, both the sale price of the new car and the trade-in price of the HHR are negotiable. Shop around and put in the work to buy something that will last a at a good price.