Hope you guys can help, as I'm getting desperate with this car...

Anyhow, basically what happened to my little automatic 04 Aveo 5 was that my timing belt broke 3 days before the appointment to change came (just my luck).
The car is slightly out of warranty so dealership work is out of the question (yes I know I waited too long to change the belt)
I took it to a local mechanic who told me he could get me a replacement engine (2006 - 15,000km) for $1900 to which I agreed to.
He replaced the engine, and 2 days after I picked up the car (and paid him) the check engine light came on, as I drove it back to his shop the check engine light began to flash and I noticed it wouldn't shift into 4th gear.
He kept this car for a month trying to figure our what's wrong, claiming he has no clue what the codes mean.
(P1781, P0300, P0700, P2610)
I got pissed and took it to a dealership myself since he was getting nowhere.
Dealership came back to me and said that the sparkplugs & wires were no good (he installed my old ones!!)
and that in order to do a proper compression test I need a tune up.
So I shelled out the $300 for the tune up, and $100 for the diagnostic.
Now codes P0300 and P1781 came up (random misfire & Engine Torque circuit/Transmission Control Module)
Dealership quoted TSB #05-06-01-030D and said I need new valves, seals, new cylinder head gasket kit.
That's another $2000 dollars in work!
My local mechanic insists it's a transmission problem
The dealership insists it's an engine problem
And I'm ready to kill them both.

HELP!

Has anyone else had to deal with this?