I don't think Socialism In One Country was as much of a policy switch as it's often characterised as, it was essentially a recognition of the facts on the ground. The revolutionary wave had failed everywhere except the Soviet Union and its energy had largely burned out. If the Soviet Union was to survive and grow stronger it had to learn to co-exist with the capitalist world. Stalin's use of nationalism and patriotism certainly became widespread later on but by the mid-twenties it was the only reasonable policy left to pursue. Permanent revolution would have led them to ruin.
However this direction wasn't set in stone, between 1922 and 1945 the Soviet Union was the only socialist country in the world* and options were limited. If another major country becomes socialist earlier, let's say Germany for the sake of argument, then other alternatives will begin to appear.
* Apologies to Mongolia and Tuva, but as they were effectively Soviet satellites with small economies I'm counting them as an extension of the Soviet Union.