The United States deals with the Russian arms sales to Iran by selling its own weapons packages to Iran's neighbors like Saudi Arabia, Israel, and Egypt. This ensures that Iran does not become too powerful and that a balance of political and military power is carefully maintained within the region.
It's important to make clear that the kinds of weapons beind sold do not pose a threat to U.S. national security--at least not yet. Most of what has been sold are tanks, fighter jets, and as of late a surface to air missile defense system. You could, however, make the argument that Russia is selling weapons to Iran, and Iran then injects those weapons into Iraq where insurgents can use to kill U.S. armed forces. At this point in time, the United States cannot do a whole lot to stop the flow of weapons from Iran or Jordan into Iraq.
In the grander scheme of things concerning Iran, the sale of a few MiGs and tanks is not a big deal. This is not the Cuban Missile Crisis. It's a non-issue. In regards to Russia's sale of nuclear fuel to Iran--now that's an issue.
The importance of maintaining a balance of power cannot be stressed enough. Yes, the United States has sold weapons to countries and now those weapons are used against us. But in no way in 1979 could we have predicted the events that have unfolded since 9/11. If we sell weapons to Egypt and 20 years down the road they use it against us, then so be it. It is always more important to deal with the situation at hand. Also, by the time they "come back to bite us", American military technology should be able to annihilate whatever weapons were sold to whatever country 20 years ago. We are careful about what we sell. We don't give away the farm.