Are you drifting off because your tired or because you lost the thread of the plot►
Tiredness is dealt with easily enough by grabbing an early night the night before the gamesession, a few fortifying caffine drinks and a decent meal. My body is usually held together at the moment with a delicate balance of sugar, caffine and ibuprofen but sleep and good food are essential to keeping you able to function. I usually have two bottles of Pepsi next to me at the table when running a game for several important reasons.
1. LID! This way you do not spill it if you knock it over (spill liquids on my books and I WILL beat you to death with my chair ).
2. Its sugar and caffine! Keeps you awake and means by the final encounter I''m a little hyperactive and eager for player deaths in a suitably brutal fashion.
3. I''m not allowed it at home (my wife does not enjoy having a 27 year old hyperactive in the house, we have enough trouble with the kids)
Another major tiredness buster (if its warm enough) is open a window and have some fresh air. Helps clear the head wonderfully.
Loosing the plot is harder to deal with but again, a problem I often have due to being immensly forgetfull. The key is your prep. Read the rules, read the adventure, make extra notes, practice an unsual rule your thinking of using or a creature you havn''t used before (all to often its after the players slay it, that you remeber the monster has regeneration or something like that). I will even write the rules into my notes so I don''t forget.
Of course any written plot goes out of the window the minute you let players near it, whenever you play (and my goodness me I am the same) you leave your common sense and intelligence at the door. Be ready to improvise and wing it, I have 3 spare star systems, 3 spare planets, 3 spare enemy starships and a bucketfull of random encounters in the file, ready to go at a moments notice.
Finally, if your flagging, the players are flagging, the table chat is getting off topic too much or all of the above, maybe just take a break, 10 mins or so, stand up, walk outside for some fresh air, maybe a cup of tea or snack, cigarette stop for those who smoke and so on. Everyone gets back to the table feeling more awake and ready to play.