The way that I tend to think about the Seven Days is this -
So firstly, the situation as of before the campaign. During June, when Lee takes command, the Army of the Potomac is large and close to Richmond; the Union is securing and regularizing their army's supply lines (sorting out the damage inflicted to the rail line) and aside from that is mostly just waiting for the ground to dry so that they can begin regular approaches. This will consist of a "battle of posts" - that is, a battle of fortifications and lunges supported by artillery bombardments, fights over good artillery terrain.
And the Union has better heavy artillery. If it is a battle of posts, then the Union is likely to win.
Lee thus has to do something to change the situation.
In order to do something to change the situation, he has the largest Confederate army that ever fought. Something like 45% of the entire Confederate muster by companies concentrates on Richmond for the Seven Days, either in the Army of Northern Virginia proper or in Jackson's army from the Valley which comes down on the flank, and there are more troops en route (another 26 regiments will arrive in Richmond by the end of July, giving Lee slightly more than half the entire Confederate muster by companies if he can wait until then) but Lee doesn't have the opportunity to wait until the end of July - that will be too long and McClellan's battle of posts will be too advanced by then. (Historically McClellan opens his regular approaches on 25 June.)
Lee's concept of operations is to attack McClellan's weaker flank, north of the Chickahominy. This is good operational theory. The flank north of the Chickahominy is weak precisely because McClellan's assault concentration is south of the Chickahominy, and it is a target that is worth attacking because McClellan's supply line is north of the Chickahominy - that rail supply line from White House Landing that the Union has spent the last month or so repairing can, if Lee is successful, be neutralized.
In order to defend Richmond, he leaves "merely" the equivalent of 5-6 Union divisions in Richmond and south of the Chickahominy (facing off against the eight divisions of McClellan's assault concentration). This is more than required for a strict defensive, but there's a good reason for this as well - the attack north of the Chickahominy will live or die on whether Lee can get all his strength deployed, and if he can't get Longstreet's corps-sized force, DH Hill's corps-sized force, AP Hill's corps-sized force and Jackson's three-division army into the fight then it won't do him good to have other troops stacked up behind them unable to get into the fight. But keeping a large force south of the Chickahominy means that he can exploit it if McClellan rushes everything north of the Chickahominy.
In addition, since Jackson is coming down from the north, Jackson can "unzip" the Union defensive position around Mechanicsville. This means the Confederate offensive isn't required to succeed on a frontal attack against well-dug-in Union works for it to succeed at its operational goals.
This part of the operational plan works fine, despite the various friction (like the delay in Jackson's arrival). By dint of deploying huge force, Lee levers McClellan away from White House Landing.
However, because the enemy (McClellan) gets a vote, Lee doesn't succeed in either destroying McClellan or in forcing McClellan as far from Richmond as he expects (and, to be clear, it's a reasonable expectation - the commander of McClellan's naval support tries to get him to retreat most of the way to Fort Monroe, since he suggests the force should fall back to Dancing Point). McClellan switches base to the James and manages some friction of his own on the way south, keeping his army intact; Lee tries to cut McClellan off by surrounding Malvern Hill, but a SNAFU involving a frontal attack on Malvern prevents this.
The end result of all this is that Lee has prevented the immediate fall of Richmond, and has done significant damage to both armies. He has, however, failed to create a situation where he can send his army away from Richmond, and the Union begins recruiting vast reinforcements with the express purpose (at the time) of reinforcing McClellan's army and using it to attack Richmond - or Petersburg - from the James.
The subsequent events of the Second Bull Run campaign are not caused by Lee's actions in the Seven Days, except very indirectly.
For this reason, I would say that the Seven Days is a victory for Lee - he intended to prevent the fall of the capital and if he had not conducted the Seven Days attacks then the capital would have been at risk of falling to regular approaches in July. There is also no clearly superior way to pry McClellan away from Richmond.
The Seven Days is somewhat clumsy and the articulation of the Army of Northern Virginia is not what it will later be, but this is because it's not had the drill and experience and (in particular) because there hasn't yet been a chance to winnow out the poor officers in high command positions and to get a better sense of how the other high ranking officers will act or have to be managed. This is not surprising. Lee has a few weeks at most to get the AoNV to meet his needs before the Seven Days; by Second Bull Run he's had almost another two months and has also had the chance to ditch the officers he doesn't like as much. He's also, of course, actually got the prestige of having saved Richmond which probably helped a lot in getting buy-in from his subordinates!