Allow me to share my experience of getting an ESTA last year...
My experience is pretty much that of Techniquest's.
The form is easy and I was approved immediately. That said, it is recommended to apply for an ESTA in advance to ensure that you are permitted to travel. If you are refused (usually because you fall foul of the eligibility criteria for an ESTA, but occasionally genuine and eligible travellers can be denied for other reasons, sometimes if someone with the same name is barred from traveling) you will need a visa to travel to the US, so it's worth leaving time to ensure you can get an appointment in the rare case that you may need it.
Of course, Tim R-T-C needs a visa. I've not had to go to London for a visa interview, but plan ahead and allow plenty of time to get the visa. You should be able to get it well in advance. Expect extensive questioning about your reasons for visiting Iraq and Iran.
Your ESTA/Visa allows you entry at any US airport, or via preclearence at Dublin or Shannon (or elsewhere). FWIW, I highly recommend travel via Dublin - EI is a great airline, and transiting at Dublin allows you to clear immigration and arrive as a "domestic" flight - this means you won't be stuck in a long queue after a long flight!
I've always found the US immigration officers to be courteous and friendly, albeit thorough. I certainly wouldn't want to get on the wrong side of them, but I think he UK border force could learn a few things from them about basic courtesy. In spite of the horror stories you hear, I genuinely wouldn't be too worried about the immigration process itself when you get to your arrival airport. I don't think the visa process speeds things up - they'll still interrogate you on arrival, and even with the ESTA it was a few minutes max.