The boys might not do it again (and I highly doubt that as that is what boys of that age do) so as to avoid punishment. This is vastly different than teaching them what is and isn't appropriate social behaviour. You will not achieve that goal, which is the right goal, with lines or an essay.
I teach at-risk kids at an alternative school, so I've been there, done that so many times. My kids have been cast away from their home school highschools because they swear too much, come in late, struggle with social issues, etc. and guess what? After a couple of days in my class with me, their behaviours start to improve. Why? Because I treat them with respect - something that was missing in their other schools. My kids hardly swear in front of me. Why? Because I let them know right off the bat, that I don't care for it, and after a couple of times, it's all good. Do I send them to the office, make them write lines or detention? Absolutely not - those punishments wouldn't fit the crime.
The boys in this scenario are 13 years old and that is what many 13 year olds do - they act goofy and silly for attention. I'm pretty sure that they are going to burp again in public, maybe not in that teacher's class, but that's only because she has taught them to avoid punishment with writing the essay.
Like I said, we have way more serious issues to worry about than burping...
Tiger