As usual, this is very likely to turn into a snake eating its own tail. Such a modernization requires Europeans cooperation (at least at first) but the only Europeans who did have enough power projection to do that then were the British. Yet the British best interest was to keep Persia weak as otherwise it would be a danger for India (it was the British who cut off Afghanistan from Persia, also).
I'm not quite sure what you mean by "European cooperation": the British and others weren't in Japan after Perry to help the place modernize, but to make money/spread their national influence. On the flipside, there was no real policy of "keep non-European countries backward" (although the Russians might well have tried if the Iranians looked like they were getting stronger).
Of course, Japan had a lot of advantages vs. Iran: a stronger central government and more disciplined population (vs. the largish poorly controlled nomadic and semi-nomadic populations in Iran, and the always rather powerful and hostile to secular power clergy), a generally more developed economy which gave rulers a bigger surplus to use for modernization (more of a genuine "capitalist" class, bigger cities, more advanced agriculture, very advanced fisheries and woodland cultivation...) a bigger population by a wide margin (throughout the 19th century Japan had at least 4 times the population of Iran), better internal communications (it's relatively easy to get around Japan by boat, compared to crossing Iran by camel), and was less geographically isolated (how much European sea traffic in the Persian gulf vs. the seas off East Asia?)
And then there's the issue that the Admiral raised: most societies _aren't_ interested in radical change. (And it's not just traditional societies: look at the USSR before Gorbachev, or to a lesser extent the difficulties so many people in the US have with the idea that the same old same old won't be sufficient to get us out of the current economic bog, let alone the challenges of global warming, peak oil, etc.) I'd disagree slightly with his statement "Those who ruled knew full well that modernizing would put in movement forces that might be a serious risk to their power", in that I doubt most Asian elites had rather little idea what modernizing might actual entail before the 20th century, (the Manchus never seemed to fully grasp the scale of the changes required) but they were aware that the power of the ruler was usually limited in various ways, and that upsetting too many applecarts was a profoundly dangerous thing.
We need 1.) motivation and 2.) ability, and both were somewhat lacking in the 1800's. It's no good if getting kicked in the ass by the Russians repeatedly leads the Shah to decide he needs to duplicate European military expertise if he lacks the resources and the degree of social control needed to push forward a rapid upgrade of the military, educational system, etc. - and is too weak to prevent the Russians from marching into Tehran anyway if they don't like what he's up to.
I'd say we need a stronger and richer Iran to begin with, one which is tough enough to look problematic to conquer entirely, one which can trade territory for time without ending up partitioned into Russian and British spheres of territory before much can be done. MerryPrankster's notion of a major upgrade of the agricultural system is a start - it increases the power of city-dwellers and agriculturalists vs. the nomadic groups and gives a more secure financial base for the monarchy, although there may be a chicken-and-egg problem here: without such revenues, where does the monarchy get the surplus needed for a major upgrade of the agriculturalm system?
A larger Iran helps: perhaps Nadir Shah has a son of comparable talent who knocks off the old man when he starts getting increasingly crazy and holds his conquests together, letting Iran end the 18th century with a solid grip of most of Afghanistan, Iraq, and a big chunk of central Asia. (But then that leads to trouble with the Ottomans when they start getting their crap together in the 19th century).
Given better means, will there be motivation? Assuming the Russians invade the Baku area early in the 19th century as OTL, will they still be victorious, or will they look elsewhere for easier prey? Russia was, after all, by early 19th century standards a very formidable power (the gendarme of Europe and all that): how many times do the Iranians get kicked in the teeth before they decide they really have to reform? The "Great Game" really doesn't get into full swing until after the 1840's, when British conquest of the Sikh empire brings them up to the borders of Afghanistan and the edges of what is referred to Central Asia, so it will be a little while before the British are going to be looking to propping up Iran as a buffer between India and the Russians - if they don't think of this larger, richer Iran as an active threat.
(Stray thought - could a Sikh-Iranian alliance beat back the Brits, or at least convince them to allow the continued existence of an existing Sikh empire as a buffer between British India and Iranian Afghanistan?)
(Second stray thought - might an Iranian empire including most of Afghanistan and threatened by Russia move it's capital to a location further from the Russian border - say, Herat, perhaps?)
Overall - I'd say although you can have post-1900 PODs which make Iran a regional "superpower" compared to it's neighbors by 2008, to have Iran a compeditor on an even level with European powers, like Japan, by the early 1900's requires PODs in the 18th century or even earlier.
BTW, as I understand it, Afganistan was independent from the death of Nadir Shah in the mid-1700's: true, the rulers of Iran tried to nab parts of western Afghanistan that they considered traditionally theirs when Afghanistan was in a chaotic state, and the British stopped them from doing that from the late 19th century on, but I'm not sure I'd call that "cutting them off from Afghanistan": they hadn't the ability to take the place over wholesale.
Bruce