The most reasonable, high-probability comments have been made:
1) Russia wanted to sell Alaska in the first place because it wasn't easy for them to hold against strong British opposition, and insofar as was known in the 1860s it wasn't worth fighting a war over to the Tsars. For them to have refrained from offering to sell it to the Yankees would have been a bit irrational.
2) Tsarist Russia might have lost it before 1917 had they decided, for sentimental reasons or because new resources were found there, to try to hang on to it. The most likely culprit would be the British, next door in British Columbia, though conceivably the British might have encouraged the Japanese to look on parts of it as a prize. Or the Japanese might conceivably have gone for it aggressively--there's no way, in the period up to the end of the OTL Great War, that Japan could take it against British opposition however. On a long shot, Japan might have grabbed first and then dared the British to do something about it--but that would break the alliance with Britain that served Japan very well OTL in this period and so I don't think they'd have tried without a green light from London.
However I think this second sheaf of comments is more speculative and less likely than some seem to think; if we assume Alaska remains a peripheral and non-decisive issue and that the general flow of European politics goes as OTL, then crossing the line to actual seizures of territory from Tsarist Russia is ruled out, and Britain would, somewhat indirectly and reluctantly, wind up an ally of the Tsar by 1914.
New ATL developments in Alaska, such as the discovery of gold and oil, would change the picture and make British and auxiliary Japanese ambitions sharper, but I think there is considerable scope for Russia to hold on to it despite that anyway. Certainly if there is a gold rush, a lot of non-Russians will be coming in, from British territories and from the USA especially, and these would quickly outnumber the Russians who would be there before, even if we assume an optimistic scenario for Alaskan development. But perhaps Russia will send over its own contingent of gold rushers. In that scenario, Alaska might remain nominally and legally part of the Tsar's empire but it will be hard for him to rule as he is accustomed with all these unruly foreigners, who would also be giving ideas to Russians who come in after the gold. Given the diplomatic situation in the late 19th and early 20th century, I think the British would still refrain from trying to seize the place directly and respect Russian sovereignty, but also given the example of Hawaii, the flood of immigrant gold rushers might support an "independence" movement that is tantamount to conquest by either the British or the Yanks.
Might Tsarist officials alternatively suppress the news of gold and as quietly as they can set up Russian-controlled mining combines to get the gold while keeping foreigners out? Trying to do that will create new flashpoints with the British and even the Americans of course, but my hunch is that if the Tsar's government can pull it off, Russia will remain firmly in control.
3) Assuming that things still go unbutterflied for the most part in world affairs, and that come February (well, March, by the Gregorian calendar) 1917 the first revolution that overthrows Tsarist power takes place in Petrograd and we have the period of the freely elected Soviets sharing dual power with the self-appointed "provisional government" of Kerensky, I daresay that given the latter's declarations of continued war effort against Germany, the Allies will continue to support Russian sovereignty over Alaska, and given the distance from the combat zones it will be very much on the back burner then. For Alaska to become a refuge for pro-Tsarists at that point would be provocative for the Allies to actively support, since they are still trying to keep Russia in the war on the Allied side by supporting the Provisional Government, but it might be what happens because Petrograd has little control over what happens in Alaska, and the Allies won't be actively hostile to the Romanovs--so there might even a bit of under-the-table support for such a development.
However, as many have said, once the October Revolution (which happened in November by the Gregorian calendar, which the Bolsheviks would soon impose an upgraded version of on Russia at last) happened in Petrograd and the Bolsheviks followed through with taking control of many other key cities such as Moscow, the Allies would have no reason to respect or recognize Bolshevik control of Alaska (or anywhere else, as the very bloody and costly Civil War period showed OTL

). Alaska is someplace they can definitely do something about; British Columbia, a distant rear area of the British Empire in the Great War, is right there on the border. Would they move in and conquer it? Or simply offer their support to refugee Whites?
We should remember, the opponents of the Bolsheviks were not all one group.
De facto, it wound up being pro-Tsarists versus Reds, but originally the Bolsheviks were also opposed by other stripes of revolutionaries who didn't want the Tsar back either, but didn't want Lenin dictating everything. As the Civil War progressed, the non-Bolshevik radicals and democrats either died, came to terms with the Leninists, or perforce got lumped in with the Tsarists, but that's not how it started.
The point being, that perhaps there are alternatives to Alaska becoming a refuge for Romanov pretensions, the Taiwan to Russia as PRC.
To get back to the original post's rather naive assumption that Russian Alaska would automatically be part of the Soviet Union by the 1920s and beyond, this is for the reasons given amply above quite unlikely. But I can see it perhaps happening as a very long-shot scenario:
1) Russian Alaska would have to develop quite a lot before 1914;
2) It would have to become a hotbed of pro-revolutionary sentiment by then, and yet remain strongly Russified, as opposed to being swamped with a majority of Anglo gold-rushing immigrants. Mind, a certain number of these types might not derail this long-shot, because working class people in general in the early 20th century had a lot more revolutionary notions floating around among them than is common to find in the USA anyway today.
3) this is the longest shot of them all--the Bolshevik faction is very strong among them, or gains strength as events progress. If a whole lot of Russian-Alaskans are on board with Lenin, following charismatic leaders in Alaska who obey Lenin's Central Committee, and hold out visions of a bright revolutionary future that inspire, conceivably they might fight off local "Whites" of various kinds and interventionist forces from the US and Britain (I think Washington would frown on any possible British suggestions of inviting Japanese interventionists in).
What, a ragtag band of Red frontiersmen fighting off the British Empire? We have to remember--while the governments in London and Washington did hate and fear the Bolsheviks and gave considerable aid to the Whites, not caring what sort of authoritarian regime the mostly pro-Tsarist generals and admirals would wish to impose (nor that, before the German surrender, the Whites were also aided by the Germans despite their promises to the Bolsheviks not to do so in the Treaty of Brest-Litovsk)--this was not exactly a broadly popular stance for them to take among the broad publics of Britain and even the USA. Had the Entente powers had the full support of their people in their anti-Red crusade, there can be little doubt the Bolsheviks would have been crushed handily, in the early years of the Civil War anyway. The thing is, they didn't; there was a lot of opposition to the policy of supporting the Whites among working-class leaders in Britain (and France) that greatly impeded the level of intervention the Entente powers could project. Also of course they were all, except the USA and Japan, exhausted by the terrible toll of the Great War; the British were also busy trying to suppress unrest in Ireland and distracted by discontents elsewhere in their Empire, notably India. It was one thing to send modest amounts of munitions and a handful of advisors to Russian White forces, and even to send some brigades to various ports--the USA had some in IIRC Arkangelsk and/or Murmansk. But I've also been told by a historian, some of those Yankee soldiers defected to the Reds!
Alaska is obviously a somewhat different case from playing the Great Game in Eurasia; it borders directly on Canada and is pretty near the USA too. And logistically speaking the hypothetical Alaskan Bolsheviks would be on their own, unable to buy anything from overseas even if they had the money (well, there is all that gold) and completely isolated from the Bolshevik stronghold in central Russia. But sending in a force to completely crush them, in terrain they have been living in for decades and quite forbidding to most soldiers from the south, might prove too costly and embarrassing an enterprise for the war-weary British and US governments to sustain, especially if some of the interventionist soldiers wind up defecting to the other side.
Alaska can sustain some agriculture, and if anyone can make a go of it, remember the scenario is that the Russians retain the demographic upper hand--they are used to really severe climates, to them Alaska might seem quite a land of milk and honey.
The really long shot part of this is, why would Russo-Alaskans be Bolsheviks at all? The Bolshevik movement was based on urban factory workers, there wouldn't be a lot of that in Alaska even if there was a big push to develop local industry to deal with the logistical costs another poster mentioned above. Miners were another source of Bolshevik recruitment to be sure (such as Nikita Khrushchev for instance) and there would be a lot of them in a Russian-developed Alaska, while Yankee and British miners were also often of a rather Reddish bent politically speaking so some of them might be Bolshevik-inclined.
Still, I would think it unlikely the Bolsheviks would win over Russian Alaska.
However Russian Alaska, if not inclined to support Lenin, might very well be at any rate not very friendly to the Tsars. Perhaps instead of a Tsarist breakaway state, it would instead be "on the fence" in the Civil War, being a refuge not for Old Regimists but the other brands of Russian revolutionaries--the agrarian Social Revolutionaries that Kerensky claimed to represent for instance, or various Mensheviks.
If their reaction to the October Revolution was to hold aloof from Lenin's claims and give refuge to those who fled (after they'd tried to oppose Lenin on the battlefield and been defeated) then that might deter the Anglo-American interventionists from trying to secure the place, leading to an independent but socialist Alaska that would flirt with both the capitalist powers and the new Soviet Union. During the NEP period of recovery in the 1920s, Alaska might consider voluntarily affiliating with the Soviet Union for mutual defense.
As Stalin maneuvered to take absolute power in the USSR, would Alaska be inevitably drawn in and subjugated? I'd think that he'd be forced to treat Alaska as a special case, because the Alaskans could cut and run if he tried to be too heavy-handed there; it would be necessary to use more persuasion and less force, unless the Alaskans themselves became convinced that Stalinist police state methods were necessary for their own protection and advancement. Assuming some healthy skepticism on the Alaskans' part, Stalin would seem likely to overplay his hand and cause a rupture of relations, leaving the Alaskans to make the best of their relations with British Canada and the USA--I don't think they'd find the prospect of aligning with Japan at all alluring.
Though there's another butterfly--what if the Alaskans figure they are not in danger of being subjugated by the Japanese and opt to become trading partners with them, on a socialist basis on their side of course (ie the government controls the trade, not private parties), providing Japan with a market for manufactured goods and with resources the Japanese desperately need? It might divert Japan away from their Chinese misadventures and from the rise of militarism there. Leading to an ATL where probably Hitler still rises to power in Europe, and a nasty Second Great War there, but where the Pacific is left in peace. Assuming that Hitler is as successful as OTL (not a certainty by any means!) then sooner or later he'll attack the Soviet Union, and I believe anyway suffer inevitable defeat there, especially with the USSR's Pacific flank under no threat. At that point, with Britain allied to Stalin, the way would be opened for better relations between Alaska and the Soviet Union, at the same time also with Canada and the USA. With both Japan and Alaska on the winning side, or anyway on friendly terms with the European victors, it's a very different 1945 indeed.
Such an independent, reddish Alaska would not pose the threats to the USA the always-Soviet one would to be sure; there is little reason why the Alaskans would want to allow one superpower or the other to effectively occupy them so Alaska serves as a passive buffer for both.
If in the very unlikely case that the Alaskans are instead somehow subjugated by Stalin after fighting off the interventionists as loyal Bolsheviks, the Soviet Union retains Alaska as integral Russian territory, once the Civil War period is past I suppose the British will grudgingly accept that they continue to border Russian, now Soviet, territory; the border will be sealed on both sides (getting very tenuous in the north to be sure!) Probably in that case Alaska will have suffered some territorial attrition, losing control of the Panhandle (annexed to BC) but maybe gaining some land in the north at the expense of Yukon--the borders will be redrawn based on who effectively holds what, the revolutionary miner natives having more of an edge in the far north. So actually there won't be much bordering in the effective sense of rival populations living next to each other, the Alaskan mainland being effectively an island. The tight borders will sometimes be to keep Soviet citizens in, but in the early years perhaps more to keep lefty Americans and Canadians out. By the 1930s everyone would more or less accept that that's where the Soviet border is, after all it would merely be a carry-over of where the Russian one was. Soviet opposition to the Nazis would tend to soften British fears, then the pact between Hitler and Stalin would sharpen them, but the border, though tense would remain peaceful. Come Hitler's invasion of Russia, things would change drastically, suddenly Alaska would be a gateway to the new Soviet ally for Lend-Lease goods--not making a big difference since the logistics of hauling stuff all the way from the Pacific to the fronts and the factories supporting them would remain problematic. Post-war, hopes of a peaceful cooperative world would fade and with the Korean crisis the Alaska/Canadian border would become tense again, with both sides building up the frontiers seriously. The USA would have little choice but to commit to major alliance with Canada--the Canadians would need the muscle of American military deployment to defend their border, the Americans would need the depth of defense Canadian territory alone could give them, so the Yukon would see a flood of Yankee bases being set up and ongoing eyeball-to eyeball confrontations with Soviet aircraft. Also, a credible threat of Soviet attack on the USA would be present from the beginning of the Cold War instead of developing only gradually.
Perhaps these circumstances raise the probability of outright nuclear war considerably. Just as well then that Stalinist Alaska is such a long shot!
