When the narrator says: "He was pretty sure..." I don't get what he meant. Tom then goes back to Autumn, she says her name and he looks to the screen with a witty face. What does all this mean? He didn't learn anything at all from the relashionship with Summer?
The point of the film was that Tom believed in the message that all of the romantic movies preached that he watched as a child, whereas Summer didn't. When the narrator says "it's not a love story, it's a story about love", he's setting up the film to show that rom-coms are generally wrong about how relationships are supposed to happen, and that this movie shows the reality of what can happen in a relationship.
Because of the romantic films he had watched, Tom had a specific expectation of how relationships were supposed to happen, and that it would follow the cliches and 'rules' that the movies set out, but his relationship with Summer didn't happen that way. Their relationship just... fizzled out, and it crushed him to learn that they weren't destined to be together when he learned that she was engaged to someone else.
However, Tom later learns that whilst their relationship had a profoundly negative impact on him and his outlook on love, and made him believe that all of those movies were false, the relationship also had the exact opposite impact on Summer, making her believe in signs and other romantic cliches, which is why she was engaged to someone who was reading the same book as her in a restaurant as if it was fate.
So when he meets an attractive stranger, as he's walking away he believes that even though it's a massively cliched meet-cute and he no longer believes in signs, he's not 100% convinced that it wasn't some sort of romantic signal like from a movie (hence the "he was pretty sure..."). This is likely because of his conversation with Summer in the park, as she has made him begin to believe that he was actually correct all along, as opposed to her cynicism being correct.
So he decides to go back and attempt to go out with her, and when she announces that her name is Autumn (as Autumn always follows Summer) he feels it is far too much of a coincidence for it to not be a sign. The fourth-wall breaking look into the camera is basically his character communicating to the audience that he understands that.