This!!! The connection between Lily’s two separate choices is a narrative parallel, not something in-universe. Unfortunately there’s a lot that you need to deliberately look for, and it’s somewhat ruined by the romantic presentation of the truth about Snape. JKR failed to follow the “show, don’t tell” guideline here. We are told that James changed, yet it’s very understandable that many find it hard to believe. The format of memories fails to emphasize the time that passed and the change that happened.
I’m really hoping to hear more about that on Pottermore. We already know that in the seventh year Snape remained obsessed with showing teachers that James was not the good person they saw, and he helped Filch confiscate the Marauders’ Map, which failed to upset James who by that point cared far more about the war and the future of the wizarding world. And I like to think that he also started to take his studies more seriously as his time at the safe place (ie Hogwarts) was about to end, and soon he would face the responsibility that any adult faced during the wizarding wars, protecting the people around you. But even this is starting to be just speculation. We really don’t know all that much about James Potter.
It’s made clear that he had to change before Lily stopped considering him as bad as Snape, but the details depend on our headcanon of Lily. And it’s important to understand that she didn’t owe him anything just because he became a better person. Hopefully that’s one of the things he understood in the process.
Via harry potter confessions.