The same thing has happened to me, I changed the head gasket, then Transmission got all screwed up. Based on what I have found out so far, at least in my case , the condensor (a capacitor that filters out all noise and high frequencies ) is mounted /grounded on the valve cover. If the valve cover loses the ground then the noise possibly from ignition zaps the TCM. I am still working on this problem, I got another TMC which I will try this weekend and let you know.
-------------
89 TrooperII, Auto, 2.6L,4x4
-------------
89 TrooperII, Auto, 2.6L,4x4