71 340 running bad

Just so you know;
I once had a 292/292/108 cam in my 367.
I retimed that cam from straight up to to 8* advanced and to 4* retarded, and she didn't much care about Idle-timing changes.
So I just gotta say this,
IMO;
if it idles, the stinking cam-timing is not your problem.
However;
every time I had an engine that wanted extreme advance to idle, the cam timing was severely retarded. But, in this configuration, it would not rev up either.
If it really wants 50* advance, and TDC has been prooved, to not stall, my guess is yur timing lite is on the wrong wire, AND the AND the ignition timing is retarded, both together.
Like I said earlier, just advance it till it idles decent, then figure it out.
BTW-1
the engine can be sucking air from the underside of the intake. You can test for this by flipping the PCV out. Sealing the CC, and plumbing a vacuum gauge to the dipstick tube. When you start it up, it should start building pressure, and you better not let it exceed 3>4 psi else the pressure may start blowing seals out. If you see vacuum on the gauge, Badaboom! that is bad, and the intake will have to come off.
BTW-2
I know you said the compression was good, but how do you know what good is? Good on a factory smog 318 is about 135psi at sealevel. But take it up to 5000 ft, and she'll be down around 110, which is still "good", on account of nothing but the elevation has changed.. and my 367 is really good at 195psi. So what the heck does "good" mean.
The reason I ask is because your engine can still run with the intake valves not sealing, and still make some pressure, it just won't be very excited about Idling, and especially not excited about starting up.
The best way of checking for this is by an LD test with the pistons at TDC on the compression stroke, no not all of them at the same time lol. If you get crappy numbers, relax the valve gear and repeat the test with the pistons at the bottom of their bores. This will differentiate between too tight a lash, and sticking or bent valves.
The thing is, when an engine sits for a long time, the valve stems may seize in the guides in an open position...... and then when the piston comes up and kisses them, they get bent. So then if your 340 is making 175 psi, which is really "good", this business is not something to worry about.
But if she is only making 140, which is better than "good" for a 318, well then, it is something to consider. But if just one is severely less than the best, well, you got a problem in that cylinder.
BTW-3
there is an easy way to check to see if your cam timing is at least in the ball-park, but your TDC mark has to be known to be accurate.
Just put #6 on TDC compression, verifying the mark.
remove the passenger-side valve cover, and remove the valve gear. Go to #6, and center the pushrods in the tunnels, front to back. Make sure the tappet cups are fully at the top of their strokes. Then just lay a small bar across the tops of the pushrods which should be level to nearly level, with the cam centerline. If it is not, just rotate the crank in whatever direction it takes to make it so; then read the balancer. Your window of correctness is, TDC to about 4 degrees advanced; but it will run, or can be adjusted to run, pretty good at up to 4 more degrees either way...... if the valves are all sealing.
BTW-4
if you have a carb with metering rods and very low idle vacuum, those rods will jump up, cuz they "think" the carb is at WOT, and thus could be richening up your idle-fuel. So look down into the primaries and if you see fuel on top of the throttle valves, you can bet this is happening.
For testing purposes just remove the springs that are under the little hats, to the left and right of the Primaries.

jus trying to be helpful.