All movements, thoughts and actions that are done for any act of Holiness are counted and recorded. There is no movement or thought whatsoever that is lost. When a person merits to break through all the obstacles and finishes an act of Holiness, then all the movements, thoughts and confusion that he had to deal with before he managed to pass and break through all the barriers, are then turned into very holy and high spiritual elements. When he was deliberating whether to perform this act of Holiness and the obstacles were surrounding him from all sides, all these obstacles, thoughts and movements are then recorded above for his benefit. Every single movement that he had to take before managing to perform the Holy act is taken into consideration. Fortunate is one who merits to jump over all the obstacles and manages to perform an act of Holiness.
(Sichos Haran 11)