Until Iran develops and or acquires significant symmetrical conventional military hardware (peer-to-peer) and implements them properly. There really isn't any standing up to the U.S. military machine effectively in the long-run if there is a decision for sustained aggression, not just a short high-intensity conflict which can favor Iran. This is why having a proper Air-force/ARMY and NAVY is so important in engaging and winning battles against equally armed opponents who will use whatever it is they have at their disposal to win.
Reality doesn't allow America to invade to Iran since it would be one the biggest military blunders in the history of mankind due to the immense monetary, resource and time investment needed to pull it off successfully but the United States absolutely can pull it off if they willed it to be so.
Well, the opposite is the case: symmetrical forces stand little chance of defeating the US, asymmetrical ones do. Beefing up the classic arsenal is useful against the prospect of a hostile neighboring state attacking Iran but not against the US. As for the long versus short war dichotomy: in fact the damage Iran can cause to American aggressors in the short term is precisely the reason why they would not press on with war because said damage will be associated with prohibitive costs.
We can't just say 'if the US wants, it could' or compare with WW2, because it is the political logic which presides over the military one, not the other way around. Technical on-paper capabilities aren't relevant in the real world if they aren't placed into their effective social and political context. And given the latter, there's no chance that the US will want to invade and occupy a country like Iran. The cost is simply too high, both in terms of human losses which the US public and political class are not going to stomach and in economic terms with the exorbitant expenditures deriving from such an undertaking, not to mention the devastating impact a closure of the Strait of Hormuz along with the obliteration of oil facilities on the southern shores of the Persian Gulf would have on the global economy. The casus belli which the US could invoke in 1941 to justify thoroughgoing engagement is and will remain absent, and American society is different from what it was back then in terms of its readiness to sacrifice large numbers of citizens for overseas wars.
The notion that Iranians would put up less of a fight than the Taleban if occupied by a foreign power no matter its origin, is pretty off track I must say. While some segments of the Iranian public might have gotten brainwashed by western propaganda, these do not form an overwhelming majority by any means. Moreover, a considerable proportion of this crowd will become hostile to the US overnight if it dared invade Iran, because at the same time Iranians are some of the most patriotic people in the world, as one comparative survey years ago showed - in that survey, Iran actually topped the list. You could witness this phenomenon live at shahid Soleimani's funeral, the largest such event in human history. Many westernized and liberal Iranians joined in to honor a martyr who in their eyes symbolized Iran, Islam and traditional values of chivalry (javānmardi). The solidity of Iran's historic roots and identity as a state, as well as its national cohesion may be matched only by Turkey at the regional level, if at all.
The fact that hostile intelligence agencies have been successful at carrying out a number of operations on Iranian soil does not imply that there's an unusually large number of unpatriotic people amongst Iranians. It's simply due to the technical competence and sheer resources these agencies are benefiting from, after all they happen to be the most powerful of their kind on the planet. Actually, there aren't more treasonous elements in Iran than elsewhere since in effect, most countries on earth are US client states where local elites and other collaborators actively participate in the submission of their nation to the zio-American empire. Also, for every successful operation by hostile intelligence services or for every terrorist attack aided by foreign powers, several others have failed.
Add to this the deep religious convictions of tens of millions of Iranians, as well as the (Shia) Islamic culture of martyrdom firmly ingrained in Iranian society. A pool of some fifty million, even just fourty or thirty million fervently religious Iranians to recruit from is enough to field a formidable Resistance army. Hence why the Basij has millions of active members on top of several million reservists.
As a result, Iranians would most certainly engage in furious and relentless Resistance, surpassing even the impressive fight put up by the Vietnamese in the 1960's-70's. Not to take away from the significance of the guerilla conducted by the Taleban, but it would doubtlessly pale in comparison to what the Iranian people would subject American invaders to.
Likewise, the notion that Iran's defence entirely depends on structured military forces and that therefore, in case of a collapse of command structures, Iranian Resistance would come to a halt is equally unjustified. For one, Iran's asymmetric doctrine by its very definition supposes minimal reliance on top-down and centralized organization. As a matter of fact, Iran's focus has been on operational and logistic autonomy of local units, in other terms empowering them to keep fighting indefinitely if central command structures go missing. The Basij, namely, has set up literally thousands of Resistance cells dotting the entire territory of Iran and capable of functioning on their own for very long periods of time. Autonomy has also been the focus of Sepah, including in its air defence and ballistic missile forces.
Then, the idea that an Iranian soldier will be preoccupied by his own survival if his commander is martyred is not particularly realistic. All indications suggest that Iranian soldiers will literally yearn for martyrdom in the path of Islam and motherland, and will hardly bother about personal survival if their country is invaded. The Iran-Iraq war is a testimony to this, but so is the recent case of Iran's intervention in Syria, where according to numerous reports the quantity of volunteers was much larger than the actual number of recruits. And the fighting spirit of Iranian and Iranian-led forces was every bit as risk-friendly and self-sacrificing as during the 1980's Sacred Defence.
Pretty telling are the videos released of Iranian fighters moments before their capture by terrorists in Syria, when they knew there's no escape and that they'll probably get executed in most brutal ways: joyfully and calmly, the soldiers start joking and laughing. Also take a look at shahid Hojjaji's serene and peaceful expression, marked by his unshakable faith in God, shortly prior to his beheading at the hands of "I"SIS savages... This type of mindset is a rarity in today's world. Not even the superpower can properly fight soldiers blessed with this sort of an intrepid morale. And the US regime knows it. One more reason why America will not try to invade Iran even if it 'could' judging by its nominal military strength, and is therefore concentrating its efforts on trying to bring Iran down through full fledged economic warfare.