I take your point, but you asked about differences. One difference was that Russia invaded Afghanistan, and the US helped Afghans fight back. In Ukraine, Russia effectively invsded in Crimea, though not in the overt way they did in Afghanistan, and annexed a chunk of a country in flat contradiction to the "guarantee" Putin, personally, had signed only a few years earlier that he would not do so. So, we know he's a liar, and that his written promises are worthless.
Maybe Putin ought to join the LibDems?
I'm not, emphatically NOT saying that the US are angels, or don't do things for their own vested interest (who does, in nation states?), or that I ageee with or support all US involvements around the world.
But you asked for differences between those two specific scenarios. I outlined a couple.
It's not whether I missed or didn't miss your point, or whether I agree with it or not, it's simply a couple of differences.