What do you suppose the dramatic purpose of a comic relief scene is? Why is the porter's soliloquy in prose rather than poetry?
The porter's scene, or the "knocking at the gate", is a much debated scene by scholars, but many agree it is the typical comic relief scene seen in Shakespeare's plays.
What lines contain the bawdy humor so often found in these scenes?
Well, the clue to some extent is in the question. It is comic relief - a relief from the seriousness of the main drama for a second, and an opportunity to release the tension which has built up through the play.
More than that though, Shakespeare, more than most other writers, is aware of the advantages of juxtaposing comedy and tragedy. An audience, just after they've laughed, are actually much more vulnerable to being shocked or moved (the theatrical construct of "The Woman in Black" by Stephen Mallatratt is one excellent example of this!).
One more thing: a comic relief scene often replays themes of the serious play in a comical way. So the porter, for example, thinks about hell and damnation, as well as about equivocation (and that last is key to the play).
The porter speaks in prose simply because it is more colloquial. It is a generalisation to say that all Shakespeare characters speak in prose, and all noble character in verse: and one that isn't true (Toby Belch, for instance, in "Twelfth Night" is just as noble as Olivia, but speaks entirely in prose). But when Shakespeare wants things to sound more like everyday speech, he quite often switches to prose. Prose, just like comedy against tragedy, when put next to verse provides a contrast. And contrasts make people listen.
Bawdy humour? How about this bit, about how alcohol prevents erections:
...much drink may be said to be an equivocator with lechery: it... makes him stand to and not stand to.
The porter's scene is in prose because he is a person of low status. Shakespeare's low status characters nearly always speak in prose to indicate their low station in life. It was assumed these people were of low intelligence, too, and the prose indicates that. The scene is one of comic relief - the still somewhat drunk porter is wakened from his alcohol-induced slumber to answer a persistent knock at the gate of Macbeth's castle. As he stumbles to the gate, he ponders on who might knock at the gates of hell; what sorts of sinners they'd be. There is a unifying theme here - Macbeth has just killed the king and in doing so, lost the ability to say "Amen". He lost all connection with God with this crime. He is doomed to go to hell, so it'll soon be him knocking on hell's gate. The bawdiest lines are 27-35 when the porter tells Macduff the three things that drinking lots of alcohol does to a man.