In both cases chronological order is obvious, so what is the difference?
I had walked along the road when I saw Dan. So I stopped, and we had a chat.
I was walking along the road when I saw Dan. So I stopped, and we had a chat.
With "I had walked," it separates the walking and seeing. Therefore, that chronological order suggests the following:
Started walking down road
Finished walking down road
Saw Dan
Stopped
Chatted
Now
However, "I was walking" gives the following order:
Started walking down road
Saw Dan
Stopped
Chatted
Now
(Note how "Finished walking down road" is not mentioned yet within the sentence.)
You most likely want "I was walking." However, there are some circumstances where "had" is better. For instance:
I had defeated the first boss when Joe finally caught up.
In this case, you want "had" because Joe caught up after the first boss battle, not during.