There is an excellent symposium on NRO on the decision to grant former Iranian president Mohammad Khatami a visa to enter the United States. The consensus is that it was a bad move strategically.
Unremarked upon, surprisingly, is that Khatami's entrance to the United States is still not assured. Khatami must produce his visa at a port-of-entry, where an agent from Customs and Border Protection (part of the Department of Homeland Security) can still deny entry to Khatami. That is to say, a visa only gives you the right to present yourself at a point-of-entry; once there, it's a DHS agent who determines if you enter the country or not.
At point-of-entry, Khatami should be subject to a vigorous interview and, unless he can show that he poses no threat the United States - which should be difficult for someone who presided over Iran's nuclear program - he should be denied entry to the United States.