I'm not going to try to get into the chemistry of the substitutes; it's quite a bit more complex than simple replacing the sulfur. I will just say that, in my experience, both Pyrodex and 777 have long shelf lives (over 5 years) when stored in dry, protected environments.
I've read, but have no personal experience, that other substitutes (in particular American Pioneer and Jim Shockey's Gold) were time sensitive, on the order of a year. Take that as a rumor until someone with first hand experience can refute or confirm it.