GQ did an interview with McCarthy, Ben Falcone (who played the air marshal and who is McCarthy's IRL husband), director Paul Feig, and much of the rest of the cast. It's worth a read (and a look at the amazing photo that comes along with it), but here are the bits that are relevant to your question:
During the Brazilian-restaurant scene, Helen's talking about this big house she has and that people can stay with her if they want. Melissa goes on this whole run of how she needs to do that because there's a squirrel infestation at her house, and a squirrel had burrowed into her vagina and was living in her vagina. I could never get it into the movie, but it made me laugh so hard.
The scene [in which Megan, stricken with diarrhea, screams,] "Look away!" [from atop the bathroom sink] was in the script, but there was this whole thing she improvised where she's suddenly screaming at the dress-shop owner, "Give me your fucking jacket!" She wanted to wipe her ass with the woman's jacket.
From the skeleton of the script, the plane ride became wildly improvised. Melissa's talking about putting a Nano up my butt, or up her butt—the Nano was going up someone's butt. I ruined millions of takes by laughing. In the scene outside the bathroom, she had to say, "Let's go to the restroom—and not rest," and after that she was free to improv. She had such good ones that I ruined. Like she said, "Do you like this leg? I got another one just like it. I can put them both over my head and comb my goddamn hair."
So it sounds like McCarthy was given quite a bit of free rein to improvise - which was, in my opinion, an extraordinarily good decision.
(There's also some evidence of improvisation in the movie's gag reel, from McCarthy and from much of the rest of the cast.)