Your answer lies in how the Academy defines the Original Screenplay category.
Over the years, that definition has itself shuttled back and forth. For instance, here's how the category was viewed in the 70s.
1973 & 1974: Writing (Story and Screenplay–based on factual material or material not previously published or produced)
1975 & 1976: Writing (Original Screenplay)
1977 & 1978: Writing (Screenplay Written Directly for the Screen–based on factual material or on story material not previously published or produced)
1979: Writing (Screenplay Written Directly for the Screen)
During that period, the official stance on Adapted Screenplay transitioned between "Writing (Screenplay–based on material from another medium)" and "Writing (Screenplay Adapted from Other Material)", before going back. Not much to glean from there. But if you study the Original Screenplay category through the years, it is clearly this section i.e.
"based on factual material or on story material not previously published or produced"
that is the basis for selection. Anything else would automatically be slotted as an Adapted Screenplay. And this rule still seems to stick, despite what they name each category.
So you see, the Academy's pick for Original Screenplay isn't based on whether the characters in the movie are real-historical figures or not. Movies like "Braveheart", "The Aviator", "The Queen", "Nixon" and "Erin Brockovich" were all nominated in the category because they weren't "officially" based on anything previously published or produced. Which includes movies, TV shows, books, stage plays, radio plays, diaries, poems, articles in newspapers or magazines. Hell, let's just expand that to fit in theme parks, action figures and dolls, blogs, webcasts and webisodes :-)
Similarly, "A Beautiful Mind", "Capote", "The Social Network", "Argo" and "Frost/Nixon" were all stories featuring real-life (even famous) people. Yet their scripts were nominated in the Adapted Screenplay category because they were based on books - the last one being a play.
Coming round to "Before Midnight". Being a sequel (based on already published/produced material), the Academy naturally casts it into the Adapted Screenplay section. But guess what? It isn't the first sequel of its kind to be categorised like that. As fate would have it, in 2005, "Before Sunset" was also shoved in there!
[I'm going to go off on a tangent here. Bear with me. Hopefully it'll be fun.]
The larger issue about screenplays, adapted or otherwise, is whether "due screen credit" was given. Or, in certain cases, whether "extended credits" were submitted before an awards jury. More often than not, that's what decides which category a film gets into. Of course, a sequel is still an Adapted Screenplay in the Academy's eyes. Until the day, I don't know, someone like Justin Lin heads it :-)
Some more thoughts on the subject. Once again, the movies in these examples are based on real-life characters or events:
"Patton" was nominated for an Original Screenplay, despite the fact that the movie was inspired by two books: "Patton: Ordeal and Triumph" by Ladislas Farago and "A Soldier's Story" by Omar Bradley. The story and screenwriting credits eventually went to Francis Ford Coppola and Edmund H. North. James Toback was nominated in the Original Screenplay category for "Bugsy". Sure, he'd researched the material from Dean Jennings' book "We Only Kill Each Other", but as far as the screen credits were concerned he was the sole author of the screenplay.
Oliver Stone's "JFK" was also based on the works of two different authors, but the producers generously gave them credit - with expected results. Having actually read the Jim Garrison books, here's what I think: The movie is so stylised - in a good way - it bears little or no resemblance to the source material. Stone could just as easily have browsed through court transcripts, got a hang of the proceedings and convinced his co-producers to drop the credits. It's nice, in a feel-good, karma sort-of-way, that he didn't.
Then there's "The Last Emperor". Here's a movie that doesn't give screen credit to the autobiography it was based upon. Well, at least in any of the versions I've seen, even the Criterion release. Yet the Academy nominations listed the script as an Adapted Screenplay.
I can only guess that the producers gave an extra credit while filling out their submission form. Not as outlandish as it sounds.
The Academy might have a working logic, but there are times when it's hilariously flawed.
I recently stumbled upon a blog post whose author was raving and ranting about - among other things - a sequel nominated for an Original Screenplay. Turns out he was right.
It's the French-Canadian film, "The Barbarian Invasions". Yes, the movie got nominated in the Original Screenplay category, and yes, it was a sequel.
How does something like this occur? One guess is that the average Academy juror's world-view of world cinema is limited to reading snippets of foreign movie reviews. And if those critics don't know their stuff, the jurors don't either.
Also, it doesn't help when producers conveniently forget to mention ties to previous movies. To further illustrate how clueless these jurors can be:
In 1987, the original movie "The Decline of the American Empire" was nominated in the Best Foreign Language Film category.
Coming back again to "Before Midnight" and its predecessor. They've come under scrutiny only because they are American films. What if that wasn't the case? Would they have slipped under the radar? My guess is as good as yours :-)