אם תעירו ואם תעוררו את האהבה עד שתחפץ (שיר השירים ב:זThe RaMBaN (in HaEmunah v'haBitachon 19, which can be found in the Kisvei RaMBaN [thank you Reb Ally!!!]) has a wonderful interpretation of this thrice-repeated verse in Song of Songs:
When you feel an awakening of sorts, a stirring of the soul, a thought or desire to do a good deed - don't let it get away! The verse says "...ad shetechpatz" - that is, until you have taken that his'orrerus and placed it in something tangible (a chefetz in Hebrew), enclothed it in a physical deed, you run the risk of losing that feeling. The only way to capture that fleeting sense of "goodwill" is to turn it into something real.
For example, Rav Moshe Weinberger relates that when he feels an urge to do teshuva, he begins humming the liturgy from the High Holy Days in order to retain that feeling.
As a tool for shmirat einayim, I find myself quoting the verse "...and do not stray after your hearts and after your eyes" loudly with the cantillation notes (this also earns me a lot of stares, which ultimately adds to the dissuasive effect as well).
Memorizing a chapter of Tehillim can be useful for this idea, or carrying a little sefer to learn something quickly when the feeling arises...
For more on this topic, see Ohr Gedalyahu on Lech L'Cha; Hachsharas Avreichim (page 109); and Imrei Elimelech.