There's an amazing principle in Judaism that HaShem judges our desires to do mitzvahs as if they were already accomplished deeds. This occurs when we are held back against our will from doing mitzvahs. This certainly can make a person feel better when they are not able to accomplish a mitzvah. In the end when he knows that his deepest desires alone connect him to HaShem whether or not he accomplishes the mitzvah -- G-d wants our heart.
This concept was created by HaShem after the binding of Isaac, when He told Abraham, because you did this thing, even though nothing had been done. He treated the desire to sacrifice Isaac as the mitzvah of actually sacrificing him simultaneously solving the paradox that Isaac had to be slaughtered but couldn't be slaughtered.
Also, the Jewish people are credited with having done the Passover laws in Egypt as HaShem commanded, even though it was a couple of weeks before that command to sacrifice the Pesach offering was fulfilled. Nevertheless, they were still credited with having been accomplished already through their desire.
"And Bnei Yisrael went and did as HaShem commanded Moshe and Aaron." Exodus 12:28 from this week's Torah portion, Bo, Exodus 10:1-13:16