Literally it's supposed to mean that Homer's gonna close Bart's mouth, i.e. shut him up, but in the commentary for Simpson Tide, one of the commenters (I think it was Bill Oakley?) mentions outright that it sounds like Homer's gonna sodomize his son. So they were probably aware that the line could be interpreted sexually, and it might have been on purpose.