When was this?
The SNES had Super Mario Bros. All Stars on it.
The N64 didn't have it as far as I know, but the Gameboy Color did (As Super Mario Bros. Deluxe in 1999). As did the Gameboy Advance after that.
It was an unlockable game on the GCN version of Animal Crossing in 2002, but you had to have the e-Reader accessory and a trading card, and nobody did because they weren't that popular.
In 2004 they released another GBA game, this one a compilation that included other Mario games as well.
In 2006 they released it on Virtual Console for the Wii for $5.
It was released on the 3DS and the Wii U as soon as those consoles were released as well.
When, exactly was it unavailable?
The Gameboy Color edition didn't come out until 1999, this is true. Even if Nintendo stopped selling SNES games the same year they published the last new title, this is still a gap of less than a year. Comparable to the gap that used to exist between a movie coming out in the theater and being released on VHS.
It looks like they were releasing new GBA games until 2007. So that covers the gap where the Animal Crossing unlockable was the most recent version, because the first Virtual Console version on the Wii came out in 2006.
I don't think we've seen a full calendar year where you couldn't walk into a store and purchase Nintendo-made hardware and software to play Super Mario Bros. since it was released in 1985.
There *might* have been a gap in the end of 1998 into early 1999. Not sure. But it's damn close to continuous.