US generally does not allow a 'sterile' transit in the international section of an airport, as is common in most other countries. If you have a connecting flight in the US, even when directly coming from abroad and leaving to a different country, you will be and must be entitled to regularly enter the US as a visitor.
As a Greek citizen, you would usually be able to use the so called Visa Waiver Program, which allows you to enter the US without what they understand as a 'visa'. You would still have to apply for an ESTA, an electronic travel authorization similar to what other countries call an 'e-visa'.
Since you have been visiting Iran since March 1st, 2011, you are however not entitled to use the Visa Waiver Program anymore. You will either need a C-1 transit visa or a regular B-2 tourist visa and will have to schedule an appointment for the visa application at the US embassy in London or at the consulate in Belfast. You can find more information from the US embassy's web page.
If this is a one time trip and you don't need the US visa for other purposes later, it might be easier for you to try to find a UK-Costa Rica flight without connections in the US. If your application is not straight forward but need additional processing, which is not unlikely with your visit to Iran, you should not expect the application process to be completed by end of December anyway. If you plan to visit the US as a tourist in the future, it may be just as clever to apply for a regular, 'full' B-2 tourist visa instead of 'just' a C-1 transit visa.