When was the first comic Western written? Beats me, but in this sparse category surely one of the best put on film is the 1969 Support Your Local Sheriff!, directed by Burt Kennedy and penned by William Bowers.
The movie stars James Garner as a fast-drawing drifter—eager to see Australia—who accepts temporarily the job of sheriff in a developing little town. There, he meets Prudy (Joan Hackett), a love interest, and trouble in the form of a family of blackguards. Swiftly rising prices in the town would have meant something to audiences in 1969 who witnessed frustrating inflation. Bowers’s script is frequently amusing and does not seem like a thrown-off item, as movie scripts today often do. It takes a lot of jabs at human behavior too: the town mayor and the council members, for example, are cowardly whoremongers. The film is nothing spectacular but it entertains—all it is meant to do.