Q. Does kavanah in tefilah mean having in mind the significance of what you are saying before you say it and while you are saying it, or can you also count as kavanah when the thoughts came to your mind only after you have already said the words?
A. Sh'loh Hakadosh (Tomid, Inyiney Tefiloh, Ner Mitzva 7) and Likutey Mahariach (Seder Hanhogas Tefiloh) write that the intention should be in our mind before we articulate the words and not the reverse, since once the words were recited you cannot fix the past. They add that: a word without kavanah is like a body without neshamah. Ramban (Igeres) and Rokeach (Introduction) also write that before saying the words one should have in mind what he wants to say.
However Piskey Teshuvos (98: 2) quotes the Zohar and Arizal the kavonos that deal with Hashem's name and other Cabalistic meanings should be thought at the time of verbalizing the brocho, not before or after.
Horav Shlomo Miller's Shlit"a opinion is that sometimes after the fact, a kavanah could be immediately realized even after the brocho has been said. This principle you find in Yesod Veshoresh Hoavodah (Sha'ar 4 – Mizrach, p.128) in regards to reciting the Shmah.
Rabbi A. Bartfeld as revised by Horav Shlomo Miller Shlit"a