Why was metafiction used so much in the Princess Bride?
Good question. I'd have to say it was used as a tool to fit with Goldman's larger goals regarding adventure fiction in the novel, which were clearly to debunk and even deconstruct it. His mastery is that he managed to do two things at once: create a fun adventure novel and poke holes in it through the larger metanarrative. The discussions of the "author" with his wife and son at the beginning, for example, are as far from heroic and idealized as possible. They are mundane, even tedious, and lack heroic moral qualities…except for the author's attempts to locate the book for his son.
He uses metafiction to break the dream and keep us from entering fully into the story, and to get us to think about what's involved in creating such dreams. It's an expose and a factory tour.