You said earlier no one would attack a nuclear power, though, because that nuclear power would attack back.
If Iran developed a "nuke," they'd have to get it delivered to the US somehow. If all they wanted to do was sneak a "dirty bomb" into the US, they wouldn't need all this development. If they want a more sophisticated, rocket-delivered weapon, then that means the weapon would have to travel from their airspace to ours. If not launched from our airspace, it would need to come from a base or submarine that would give us some warning and some idea of where it came from. This would mean swift retaliation or interception of the projectile. If it is a "traditional" large bomb, it needs to be delivered by an incredibly slow-flying bomber.
Iran's most immediate target, if it decided to have one, would be Israel because of proximity, size, and general history between the nations. Even then, Israel would proceed to retaliate as well. The only "advantage" in that scenario for Iran is that other nations in the region would then possibly proceed to attack Israel for retaliating against Iran.
This would, in theory, be a good time for a pre-emptive strike, but it would not come without consequences. Would an attack on those Chinese troops assembling at the border kill Canadian citizens by accident? What would Canada's reaction to that be? Are the Chinese there with Canada's permission? Are we having to liberate Canada as well? There are a bunch of questions to be answered, but this is one of those extremely unlikely scenarios that would make one say "Okay, fine, I'd consider some military action in that case."
The thing, though, is that military technology has evolved. Actions like this, if they were to take place, should be fast and decisive and that's all. I doubt there'd be any excuse for posting sentries and military bases on the Canadian side of the border, citing the potential for a repeat of the same situation. I doubt we'd occupy Canada, or even a chunk of it, for 10 or 20 or 100 years.
It's only when we get into "missions" like the ones we're in now that we get mired as a nation. Think about it. We went into Iraq to get all the WMDs. Well? We haven't really found any alarming caches of WMDs. So either we should take our troops out, or dedicate the ones there to finding WMDs. Even though this latter option seems incredibly futile, I'd at least have some respect for it since it would mean they were still trying to carry out the stated mission objective.
In Afghanistan we are "hunting down the terrorists who masterminded 9/11." That is a moronic objective. It's not like we have definitive authorship on a set of plans or documents (assuming no conspiracy, just for the sake of argument here). Is there a distinct list of people we are killing, and then we're out? Do we just hang around in Afghanistan until we stumble across Bin Laden? Does anyone in their right mind think that's likely to happen? Even with all of that known, the troops in Afghanistan are not spending all day looking for Bin Laden or whoever. They are "securing." Secure this place, and that place, and then someone gets "lucky" and a drone attack kills someone that, we are assured back home, was Al Qaeda's #3 in command. That job has an awful turnover rate.
* * *
There seems to be no really good standard for evidence that you can apply for a pre-emptive "national action," which is what a war like we're discussing would be. When Bush talked about WMDs, a LOT of people believed it. It didn't even matter that they weren't the people behind 9/11, either; people were convinced Iraq was a terrorist haven and needed to be flattened. To some, it wasn't even pre-emptive! It was "revenge and justice." One has to be very careful going down that slippery slope of pre-emptive war based upon good evidence. Good evidence for a pre-emptive action is also, by its very nature, incredibly urgent... which can also mean that the benefit of hindsight will reveal it wasn't really as reliable or urgent as it seemed at the time.