At the end of this movie, Sheriff Bart shoots the bad guy (Hedley) in the groin and waltzes into a movie theatre with his buddy Jim to watch the ending of (yup) Blazing Saddles. So he's basically watching himself act in the same movie that we're watching— how's that for mind-bending?
In the typical Western style, our hero Bart tells the people of Rock Ridge that he needs to move on now that his job is done. He tells the people that wherever there is injustice in the world, that's where he needs to go. How heroic, eh?
But the townspeople tell him he's full of it, and he admits that he wants to leave because without bad guys, the town has become super boring. This is your typical Mel Brooks moment: a refreshingly honest take on an old and tired cliché. Sheriffs aren't noble—they're addicted to adrenaline.
After Bart rides off with his buddy Jim, the two get off their horses and into a waiting limousine. This gesture offers Mel Brooks one last chance to remind us that nothing we just watched has been real. This is an important detail, because it reminds us not to take seriously any of the racist jokes we've seen throughout this movie.
Or in other words, Brooks wants to remind us that despite the racist jokes, Sheriff Bart has always known what he's been doing and has always been one step ahead of us.