Right, here we go, I remember this happening at the end. Or someone else had the exact same dream as me and wrote it up on the internet.
The Dream: Suddenly, Meg wakes up back in Ludlow, Kansas. Her mother and her Aunt Bette tell her that her friends and family are waiting downstairs to wish her well before her wedding next week: her wedding to Tim! A confused Meg wonders what is going on. She goes downstairs and sees Tess, Gregory, Olivia, Annie, Brad, Amy, Tyus, and pretty much everyone else from Sunset Beach, all dressed in typical Midwestern clothing. Tim is also there, flirting with many of the women present. Meg announces that she had a dream, and they were all in it. In the dream, she went to Sunset Beach. It made her realize what love really is, and how none of them should settle for less than they deserve. The doorbell rings. Meg answers it, and Ben is there. He ran out of gas and wants to use the phone. He starts to introduce himself, but Meg already knows what his name is.
The End: Back in Sunset Beach, it is morning. Meg wakes up. She's with Ben. She tells him about her strange dream of being back in Kansas. Her life in Sunset Beach is real, Ben assures her.
There, that makes perfect sense.