Is this scene in the books? No, it obviously isn't. But I think there's a really good argument that the scene from the movie, or at least a scene similar to it, deserves to be in the books. Hear me out.
What the movies are noticing is that there's a significant subtext that students are drinking drinks that are stronger than butterbeer at Hogwarts. Here's a quote from Order of the Phoenix:
Harry didn't answer, but flung himself out of the room and began to fight his way through the milling crowds outside. Two floors up he met Seamus and Dean, who hailed him jovially and told him they were planning a dusk-till-dawn end-of-exams celebration in the common room. Harry barely heard them. He scrambled through the portrait hole while they were still arguing about how many black-market Butterbeers they would need and was climbing back out of it, the Invisibility Cloak and Sirius's knife secure in his bag, before they noticed he had left them.
'Harry, d'you want to chip in a couple of Galleons? Harold Dingle reckons he could sell us some Firewhisky -'
And it's not just that students are smuggling drinks into Hogarts. Some of the professors--notably Slughorn in the Half Blood Prince--are giving students alcohol!
"Pick-me-up, that's what he needs," Slughorn continued, now bustling over to a table loaded with drinks. "I've got Butterbeer, I've got wine, I've got one last bottle of this oak-matured mead ... hmm ... meant to give that to Dumbledore for Christmas ... ah well ..." he shrugged "... he can't miss what he's never had! Why don't we open it now and celebrate Mr Weasley's birthday? Nothing like a fine spirit to chase away the pangs of disappointed love ..."
- Teachers are giving students drinks.
- Students are smuggling in drinks.
- Students also have access to things like refilling charms that would guarantee them an unlimited supply of drinks.
I'm sorry, but I can't look at this situation and not think that students wouldn't have access to alcohol and that, a significant portion of them at least, and most likely the older students, wouldn't be drinking it. Obviously, I'm not saying that everyone at Hogwarts would drink, but a significant portion of students would, and it would be a part of the social life at Hogwarts; people would drink at parties and so on.
But despite all this, the trio's experience with alcohol appears to be nonexistent. The first time Harry is affected by a drink is in Deathly Hallows:
"No," Harry said aloud, and they all looked at him, surprised: the Firewhisky seemed to have amplified his voice.
In fact, in the Half Blood Prince, when Harry is with Hagrid and Slughorn in Hagrid's cabin, he apparently is so inexperienced with alcohol that he needs the Felix Felicis potion to tell him not to get drunk:
Both Slughorn and Hagrid drank deeply. Harry, however, with
the way ahead illuminated for him by Felix Felicis, knew that he
must not drink, so he merely pretended to take a gulp and then set
the mug back on the table before him.
I find it very unlikely that at least one member of the trio wouldn't have experienced alcohol at Hogwarts. Yes, there are some rules about alcohol--Hermione tells off Ron for suggesting that they drink Firewhisky in the Order of the Phoenix:
'You know what?' Ron murmured, looking over at the bar with enthusiasm. 'We could order anything we liked in here. I bet that bloke would sell us anything, he wouldn't care. I've always wanted to try Firewhisky -'
'You - are - a - prefect,' snarled Hermione.
'Oh,' said Ron, the smile fading from his face. 'Yeah...'
But I have huge doubts about the strictness of these rules--Slughorn offered Harry a drink on more than one occasion. And regardless, I just can't see Ron, for example, not drinking at Hogwarts if that was part of the social life there. I don't think any of the trio are teetotalers or have a commitment to not drink--they all drank the firewhisky after Moody's death. So it seems like at least one of them would have gotten drunk at Hogwarts. And the fact that we the reader don't get to experience this with the trio is a huge loss in terms of our ability to be at Hogwarts and share their experiences. And the fact that the movies do take us to that particular aspect of the characters lives is an aspect where they are, in my opinion, better than the books.
So why Hermione in this particular scene in the Half Blood Prince movie? To be clear, I don't see any reason why Hermione specifically should be the one shown being tipsy, and not Ron and Harry. But I do think that odds are at least one of them has gotten drunk at Hogwarts. And in the context of the scene--Hermione just dropped a huge hint to Ron about their relationship--I think it makes sense for Hermione to be drinking at that particular moment, even if most of the time at Hogwarts she wouldn't want to drink because of her responsibilities as a prefect. Remember, these rules are most likely not that strict, and while Hermione cares about the rules she, like any other person, isn't a robot who follows them every moment of her life. Obviously, there is some subjectivity here, but on the balance I think it makes sense.
This is an instance where the films picked up something that was never stated explicitly but was hinted at. The funny thing about stories is that they are constantly retold and reinterpreted. If we go by the books--the version of the story that comes after extensive revision by the author, but the version that has not yet been subject to reinterpretation by fanfiction, by movie producers, and even by the author herself--then no, Hermione never got drunk in this particular moment. But adding this additional scene makes the subtext explicit. It provides a window into life at Hogwarts that previously could only exist in the reader's mind. I think it makes for a richer, better story.