Based on characters created in a 1969 pilot for an unproduced series entitled "Sheriff Who?", because every week there would be a new sheriff (played by a guest star), who would be killed by Evil Roy Slade.
Roy Slade's name is supposed to be an acronym for "Sneaking, Lying, Arrogant, Dirty and Evil."
At one point, Evil Roy Slade considers changing his name. He runs through three possibilities, but they all begin with the word "Evil". The third one, "Evil Lee Rich", is an inside joke: writer/producer Garry Marshall co-produced a sitcom called Hey, Landlord (1966) with Lee Rich.
Although the year is never explicitly given, a calendar is shown during a time passage montage late in the film, going from November into January. The calendar has the right dates for the movie to be set in the Western-appropriate years 1861/62, 1872/73, 1889/790 and 1889/90.