Difference between "in" and "for"

As @user user21497 points out in the "In a while" vs. "for a while" thread you link to, there are large differences in the meaning of in a while and for a while in certain contexts

I'll give this to you in a while. [Not now, but maybe tonight or next week.]

I'll give this to you for a while. [You can have it for a week or maybe a month, but then I want it back.]

but only subtle, a subtext (RegDwighт), or negligible (at most) (user 21497), in others:

Haven't heard anything from you in a while.

Haven't heard anything from you for a while.

This should indicate that 'rules' are complex if worth trying to find hereabouts. And John Lawler says effectively that adding negation to an example complicates the analysis enormously.

...............

With your examples,

I walked along the shore for 10 minutes.

As Talmy says, the ten minutes is a fixed (if approximate ... say to within a few seconds) timespan, and the implication is that a longer walk was quite possible. As for any implication that the walk has ended: this is governed by the verb (walked) rather than the preposition. 'I have been walking along the shore for 10 minutes' gives no indication that the walk has ended. 'For' does, however, indicate that the time interval being considered has ended (for 'have been walking', from ten minutes ago till now).

I walked through the tunnel in 10 minutes.

sounds most unnatural except as either a claim of a rather fast time for the journey, or an explanation (to someone asking how long a hike would take, or [perhaps under protest] to a police officer querying one's morning activities).

When acceptable, it certainly demands, as Talmy states, that the ten (-nish) minutes was a fixed timespan, and that the whole tunnel was completed. And what other preposition would one use with the paraphrase "I did the tunnel in ten minutes"? One would also say "I walked along the beach in ten minutes" in similar circumstances.

(But note that 'through' actually implies completion also, whereas 'along' usually involves non-completion.)