After going through a bad rebuild, I've come to the conclusion that it's just NOT cost effective to rebuild a 3.4 the correct way (with OEM parts). I skimped and did it with cheaper aftermarket parts and my motor only lasted about 1.5 years until I had head/valve problems again among other issues like a leaky rear main seal. That left me with the decision to rebuild it again the right way (for about $4K+ with labor - top and bottom), or just get a lower mileage donor motor to swap in.
I do think it's worth it to pull the heads and see what you're dealing with first though. If it's just a head gasket, then I say throw a new set on, resurface the heads and go with it. No need to rebuild the top end if it's just a bad gasket. However if the heads are cracked, severely warped, or have valve issues and need to be rebuilt, then it's going to be a very expensive job to do with OEM parts. And take it from me, DONT use aftermarket crap. You could either try to find a used head(s) and put that on or just get a whole new donor motor. Either of those will be cheaper than rebuilding with OEM parts. And granted, there is always a risk when you buy a used motor or parts, but the price is worth it IMO, especially if you can get a warranty with the donor motor or heads.
Definitely DO NOT use the coolant additive gasket sealer like Stop Leak or Thermagasket. They may work for a short time, but will undoubtedly restrict flow (or clog) your cooling system and water pump. I tried that crap on my truck before I rebuilt it, followed the directions to a tee, and it almost immediately blew my water pump (in like 10 minutes).
So if I were you, if it's not just a bad HG, I would just find a low mileage donor or a used head and go from there. I got a 3.4 with 127K and it's actually being swapped in as we speak. I paid <$500 for the motor, but $800-1200 is about average. If you can do the swap yourself, this would definitely be the cheapest option.