Stalin introduced the "Socialism in one country" dogma, not at least as a reaction to Trotsky's expansionist dreams and as a precautionary step until USSR got strong enough.
"Socialism in one country" was an attempt to keep up the morale of the Bolsheviks after the failure of Europe to undergo successful Communist revolutions in 1918-23. If did *not* mean that the USSR would give up on encouraging revolutions abroad, only that as of circa 1925 there seemed little immediate chance that such revolutions would succeed (at least in Europe) and in the meantime the USSR could build socialism even without such revolutions.
I agree with Leszek Kolakowski, *Main Currents of Marxism*, "It is possible that if Trotsky had been in charge of Soviet foreign policy and the Comintern in the 1920s he would have taken more interest than Stalin did in organizing Communist risings abroad, but there is no reason to think his efforts would have had any success. Naturally he used every defeat of Communists in the world to accuse Stalin of neglecting the revolutionary cause. But it is not at all clear what Stalin could have done if he had been actuated by the internationalist zeal which Trotsky accused him of lacking. Russia had no no means of ensuring a German Communist victory in 1923 or a Chinese one in 1926. Trotsky's later charge that the Comintern failed to exploit revolutionary opportunities because of Stalin's doctrine of socialism in one country is completely devoid of substance." https://books.google.com/books?id=qUCxpznbkaoC&pg=PA807