There are 5 more episodes after E8, which revolve around them making the "Adventures of Mikuru Asahina Episode 00" episode for the school's cultural festival. Basically, Haruhi forced them all to make a movie, and is secretly jealous of the fact that Kyon likes Mikuru (though it's never actually said in the show) so it sort of explains why she comically "abuses" her in every episode. It gets to the point where they have to make a kissing scene between Koizumi and Mikuru in the movie (which is assumed to be revenge against Kyon and angers him), and without anybody knowing, Haruhi gets Tsuruya to slip a roofie into Mikuru's drink. Kyon finds out (and is obviously angry), but then when Mikuru doesn't kiss Koizumi even while drugged, Haruhi responds by repeatedly bopping Mikuru over the head with a megaphone while berating her for not acting her part correctly.
This constant abuse of Mikuru makes Kyon even angrier, until he eventually snaps and swings at Haruhi, only to have Koizumi grab his fist in midair. Haruhi flips out at what just almost happened, and screams at Kyon while on the verge of tears. The next day at school, she's depressed and won't talk to anyone. Koizumi tells Kyon that it's because she thought Kyon would be the one person to agree with her no matter what, so it's up to him to get Haruhi in a better mood before she destroys the world.
After that, Kyon shows up in the clubroom and there is a glimpse of Haruhi holding her hair up in a ponytail the way that Kyon said he liked back in Season 1, but she drops it when she notices him walk in. Kyon apologizes for trying to hit her (by agreeing that the movie needs to be finished, though he technically doesn't actually say he's sorry for what he did), Haruhi is instantly happy again, and they resume with the movie. It turns out that Haruhi has been confusing the movie with the real world, and what she's written to happen in the movie is happening in real life (such as talking cats and Mikuru being able to fire beams from her eyes.).
In a somewhat Deus Ex Machina move, Kyon finally gets Haruhi to realize it's just a movie at the last minute by placing a "This is a work of fiction, and all of it was made up" notice at the end of the movie. Haruhi watches it, and upon seeing the notice, realizes that none of it actually happened, and the world instantly reverts back to normal.
Then Season 2 ends with Kyon explaining to Haruhi that Koizumi is actually an esper, Mikuru is actually from the future, and Nagato is actually an alien, which just pisses Haruhi off because "it'd be too convienient for it to end up that way." Obviously, she doesn't believe him and still doesn't know of her powers. Then she walks out of the restaurant that they're in, and it appears as if they're about to do something else, but the episode ends.