The government could have- if they wanted- limited him to the UN and then put him on the next plane back to Iran instead of letting him traipse about NYC.
My own sense of it is that Ahmadinejad's visit will have little or no effect on people's opinions. The fact is (I believe) most "true Americans" could care less about whether his government is persecuting a few intellectuals or homosexuals. What they care about is whether Iran is supporting the insurgency in Iraq, or developing nukes to wipe Israel off the face of the earth.
There is nothing he could say to address those points. I gather he didn't bother to try.