How do you score this instance in pegging?

Had an interesting lay of cards during pegging with 4 players. I was wondering how one would score this:

P1: lays down 7
P2: follows with a 4
P3: plays a 3
P4: makes a run for three points with a 2
P1: then plays a 6
P2: places down a 5... does this complete any runs for any points?

6 card run

While they are played in a disjointed order these cards: 2,3,4,5,6,7 constitute a 6 card run. Never seen that one before. Congratulations.

More than 1 run

Please also note that the 4, 3, 2 is also a run that P4 should have taken. P2 also does get a run for 6, and if P1 had an Ace lurking back there, they could have nailed it for even 7 points.

Pegging double tripple

Scoring help.

P1. 6
P2. 5
P3. 4
P1. 3
P2. 5
P3. 5
P1. 3

We scored it as 40, is that correct?