The front head comes off quite easily with the engine in the car. The rear head is more difficult, but possible. The are posts in the 164 discussion on it. You have to loosen motor mounts and rotate the engine forward to get the head to clear and come off. I fyou have many other things to do, it's probably advisable to pull the engine.
Thanks to everyone who is responding. I've decided to try replacing the head gaskets with the engine in the car, (1993 164L). I think the shop manual is telling me to remove the fuel manifold with the injectors still attached, is this correct? I've removed four screws holding the manifold onto the heads and one screw holding a bracket on the supply side tube. I tried prying each injector gently, but I still cant remove the fuel manifold/injector assembly. Is there a trick to removing this assembly?
I take it you have removed the rubber gas lines?
you might want to spray some wd40 where each injector goes in to the head.
it can get some gunk there and make it hard to remove. if they just will not come I think you can leave them in there and pull the clips on the rail and remove the rail from the injectors. I think you could leave on the intake tubes too. just pull off the plenum. The timeing belt, water pump(should replace this with the timming belt). and the heater hose,headers,oil pump drive gear nut. oh and the top motor mount.
then take off the valve covers. undo the heads bolts a littel at a time in the order the book shows. then give the had a good wack with a big rubber/leather mallet(or a kick with the food if you can get in there. ) and then lift it off. if the studs look frosty a shot of wd40 might be needed.
this is all from memory so I might have forgot somthing.
and do not lose the oil pump drive gear.. one time when I did this I fliped the head over and sat it down and the gear fell out and I did not notice untill I went to put it all back and could not find it. it is best to pull it out with a magnet when you un do the nut and place them in a small ziplock in a safe place.