I know I've found this book before. I read it somewhere in the late 1980s to the early 1990s. It was short, maybe 30 pages or so, and involved a young girl on the bus, on her way to school, who I think has to write a story for an assignment, but can't think of anything. While looking out at the trees, they start to look a bit strange, then she suddenly realizes she's in a carriage. When it lets out, she's in a medieval fantasy world where she is destined to help retrieve the royal family who have been abducted by magic. She's helped out by a dwarf who is also the court jester. I remember she acquires a magic rope (I want to say that it's bright yellow) that's highly elastic and one end can magically stick to a surface, which she uses to get through a window. She's attacked by flying monsters during the story, who I think turn out to be the missing princesses, with the dwarf being revealed to be a transformed prince. At the end of the story, she's sent back on the same carriage, and suddenly finds herself on the bus, unsure if she dreamed the whole thing, but also happy that she has her story to write.
The cover was done in a semi-realistic style (it didn't look like a photograph, but it was not cartoony) with the girl (maybe in modern clothes) standing in a stone-walled place with the dwarf more in the foreground, in mid-caper, while one of the flying creatures seen through the window in the background, or maybe in the middle of attacking the girl, who is fending it off.