The chances are, you underestimated the P-38 a bit. It's not surprising - many of even the best pilots have a tendency to do so.
For a long time people used to make fun of the P-38 in these boards, emphasizing the "good plane overall, but best in nothing" aspect - well,

some close comparisons have proved that while the AH P-38L is indeed 'best in nothing' in individual analysis of the may attributes, when those things come together as a whole, surprisingly, the P-38L is a magnificent plane for combat. Here's the
link where people discussed the P-38L a while back.
As you can see from my analysis there, the P-38L is a real killer! Probably nothing short of the planes that turn as about as good as the Spit9, can out maneuver a P-38L in a close-quarters, rolling scissors combat.
...
I remember an incidence where I engaged an enemy P-38L in a Bf109G-2 - I think it is simular to the situation you have met. The P-38L pilot wasn't particularly good, and I quickly neutered his E state to about as equal as mine. But it became quite problematic when he decided to just keep pulling loops!
Contrary to from what I first thought, it became evident that no matter how hard I try to follow his loop after loop after loop, he wasn't going to drain enough E for me to catch him on his next loop attempt!
Normally, when some other planes do this, usually a clever management of how hard you pull the stick(exactly as suggested by Badboy in his first post, first sentence) can earn you enough E advantage to nail him on his third or fourth loop attempt.
Even planes that are as maneuverable as Spitfires can fall prey to this - when a Spit loops very tight, he's gonna pull hard on the stick, meaning that he spends a lot of E for that maneuver. So, when he goes upwards into a loop, you follow loosely, ease up on the stick. While the Spit conitnues the loop downwards, you're still going up.. and by the time the Spit comes up again, thinking he's gonna catch you, you can shift yourself into a classic double immelmann to rope him.
But no, not in the case of the P-38L. The P-38L is a rare plane where continuous loops, can actually be an effective and simple counter move to the inexperienced, due to the fact that the P-38L accelerates well(gains enough E to provide for the next E-bleeding tight loop), climbs well(less of a burden when the flight path shifts upwards), turns well(can effectively keep a tight loop radius without excessive E-bleeding), zooms well(it loops fast), and also, is torque-absent(if needed, can resort to extreme low-speed, elongated loops without fear of a flat spin).
So what happened was that I couldn't get enough lead in any of the loops I followed - thus, I had to do some other things to finally nail him. Since I knew he wasn't going to suddenly switch to a long elongated immelmann/hammerhead, but just keep doing tight radius loops, I switched the pure vertical contest into a semi-vertical one. When he went into a pure vertical loop, I went a 45 degrees slanted loop, something resembling a high yoyo, so when he came down from the loop, I didn't follow him at his six, but rather met his 4 or 8 oc angle. The pretext to this method was that I absolutely knew that he'll keep looping. If the P-38L had seen me doing this, and changed to a long extended immelmann style loop, I would have been pressed to defensive.
So effectively, if you get in a situation where a P-38L keeps looping and you can't nail him in the first few phases, then it means you've fallen into a situation where the P-38L neutered your E advantage in turn, and can gain the upperhand in tactical advantgae if he was smart enough to realize that.