Yeah, that's what I've been thinking too. I doubt they'll shoot for Gunsmoke's episode count though, since that show had 635 because it did more episodes in a season.
The thing is, though, if they were to end the show before Law and Order does, Law and Order would just surpass The Simpsons' record two years later, so that might have a bearing on when they decide to end it. But enough about records.
I recall the cast is signed for another two years beyond Season 22, but who knows. Cast members usually get signed on longer than a show is necessarily intended to run just in case.
After the series does end - which can't be that long now - apparently they plan on doing another movie to cap it all off. They apparently don't want to do another movie while the show is still running, since working on both at the same time was really hard for them. Fox would obviously be up for a sequel after how much the first one made.