Shin Yoshida, the head scriptwriter understands Sorachi's sense of humour to the point him and his writers were basically given complete control of anime original stuff by Sorachi up to including original jokes making fun of Sorachi himself. In an industry where head writers usually stay on for maybe 12 or 24 episodes, Yoshida stayed on for nearly 400, which is absolutely insane. Fun bit of trivia is that one of the longtime writers under him, Yamatoya also owned a racehorse named Just A Way after the Gintama gag, and it became the number 1 racehorse in the world back in 2014.