The Gemara (bottom of Sota 22a and Bava Metziah 107a) brings several stories involving Rav Yochanan. One story relates that he noticed a woman who had come to daven in his shul, who could have davenned in a shul that was much closer to her home. He asked her, why did you have to walk so far to daven? She answered, "Rebbi, velo schar pesiyos yesh?" Rebbi, is there no reward for the walking?
This is very strange. Why would you be rewarded for walking to a farther shul when you could daven just as well in one that is close to your house? How about if you took an unnecessarily circuitous route on the way to shul? Would that be a mitzvah? Would it be a spiritual endeavor, or would it be merely aerobic (inspiration or respiration)? (It doesn't say that she came to Rav Yochanan's shul because he was the holy and righteous leader of the people, so don't quote me meforshim that say that pshat, because it's just revisionism, and the Torah says "midvar sheker tirchak".)
One might say that this concept is specific to Tefillah. For example, the Butchatcher's Eishel Avraham says that it is because tefillah is like bringing sacrifices, and in Avodas Korbanos the carrying of the sacrificial parts, the holacha, is an independent avodah. Also, one might say that as one walks, he thinks about the tefillah he is going to, and so his thoughts become a part of his davenning.
In fact, the Netziv here says that the Mechilta Rashi brings is based on the fact that specifically by Korban Pesach it says "Mishchu Uke'chu," draw forth for yourselves a korban pesach, so "schar hachana karov li'schar guf hamitzvah." Again, this indicates a narrowing to the context of Korbanos.
Also, see Bava Kamma 106, where there is an opinion that the land portions in Israel which were farther from Yerushalyim were more prestigious, because their location mandated greater effort in coming to Yerushalayim for the Shalosh Regalim.
UPDATE, EREV ROSH HASHANNA OF 72.
I am copying over to here something I had written elsewhere on this website.
The Gemara in Bava Basra 122a (אלא לקרובה ורחוקה) strongly implies that the closer a tribe's land was to Yerushalayim, the better the portion. This is how the Rashbam learns the Gemara- because it is closer to the Kedusha of Yerushalayim, and farther from the dangerous borders. I once heard from Reb Moshe that one can say the contrary as well- that the farther from Yerushalayim the better, because then you have to walk farther on the Shalosh Regalim, and for every step there is schar halicha (e.g., the woman Reb Yochanan talked to in Sotah 22a). You are placed in a situation where you have to do more hachana. I never understood how he could say that, when the pashtus of the Gemara in Bava Basra is directly opposite. I understand that drush is more flexible, but how can you say the exact opposite of the Gemara? I then saw that the Chasam Sofer here says exactly like Reb Moshe.
מיהו לולא דברי הרשב"ם היה אפשר לומר דרחוק היה זכות יותר דאיכא שכר פסיעות לילך למקדש
In any case, this concept is brought in Shulchan Aruch, at least in the context of tefillah. The Magen Avraham in 90:22 says it is better to daven in a more distant shul rather than your Friday night default shul.
But there is an interesting teshuvas Chasam Sofer (ChM 176)that seems to apply schar pesiyos more generally. The story was that there was a shochet who was a leitz, like a class clown. He loved to tease the local tzadik, the mohel. When he had a child, he sent word to the mohel that he needed him to come out to his house. The Mohel traveled four hours, and walked in to general laughter, as, I imagine, the gathered leitzim all said, "Stop the Moyel, it's a goil!" (An old east side joke.) The questions asked of the Chasam Sofer were whether to prohibit the shochet from shechting in the area in the future, and also whether he owed the mohel money for the trip. I don't remember whether he says to kick the shochet out; but he does say that since the mohel was promised the opportunity to perform a Mitzvah, the shochet has the obligations of one who hires a laborer and leaves him sitting idle; therefore he has to pay him the value of the unperformed mitzvah, which the Gemara sets at ten gold coins. Then the Chasam Sofer says that he also has to pay for the schar psiyos, the effort expended in reliance on the promise of performing a mitzvah which turned out to not be a mitzvah; but he says he doesn't have any sources that quantify a value for schar psiyos, so he can't assess a monetary penalty for that, and whatever liability results from that will have to be left for dinei shamayim.
There's also an Aderes Eliahu in Devarim 1:12 that applies schar pesiyos to bikkur cholim, which is alluded to (see Sotah 12) in the words "haderech yeilchu bah," but his explanation of the specific connection between schar halicha and bikkur cholim is terse to the point of obscurity.
UPDATE: I have a mehalach, so to speak, to answer this question, in a new post on this week's parsha, here.