Keeping Safavid Persia with the borders above would be... difficult to say the least. Some of those territories were only held at the beginning of Shah Ismail's reign, when the centre of gravity in the Safavid State was arguably more toward Eastern Anatolia and the Caucasus rather than Persia proper. Arguably, it would be easier for Safavid Iran to maintain these borders.
As to how Iran could last, it's actually not as hard as you would think. Persia was politically stable, at least at the center. The downfall of Safavid Persia came largely due to the revolt of the Hotaki Afghans, who were not particularly numerous or well-equipped. The lack of warfare experienced after the peace between the Ottomans and the Safavids in 1639 led to the atrophy of the Persian Army's fighting ability. If you could maintain some conflict between Persia and its neighbours, it is likely that the Safavid Army could remain strong enough to defeat any internal revolt. Alternately, avoiding the later intensification of persecution within the Empire may also avoid a rising among the Sunni Afghans.
So enough of the how, and more of the what happens next. Assuming that the Safavids continue to have Shahs in a similar mold to Sultan Hussain, the leadership at the center won't be tremendously inspiring. Life in outlying provinces will continue to be dangerous, especially the east which was subject to slave raiders from Turkestan. Still, without the ravages of the Hotaki Rebellion, the Ottoman and Russian invasions as well as the reign of Nader Shah and the associated Civil Wars, Persia would be likely to have a better 18th century. The population is likely to remain closer to 9 million rather than decline to 6 million, and may well increase with the greater dissemination of new world crops (Potatoes grow well in Afghanistan for example).
Economically, the situation would not be too brilliant. Like Europe, Iran suffered from a trade deficit with India and the end of the 17th century had seen increasing amounts of bullion flow east. Without significant political change, I'm not sure how this could change, and it seems likely that Persia's balance of payment would continue to remain poor, contributing somewhat to a demonetisation of the Iranian economy. However, the survival of handicraft industries and carpet making, which collapsed following the Safavid Collapse in OTL, may alleviate the economic situation somewhat compared to OTL.
So by the 19th century, we are looking at an Persia that is at least somewhat more prosperous than OTL. When the Russians begin knocking on the door, the Persians may well be able to field more significant resources than in OTL to combat them, which means that the transformation of Persia into a mere buffer zone may take longer than usual. However, much would change by the 19th century as a surviving Safavid Persia has an enormous impact on India, which by the 19th century would probably have a significant impact on Europe too.