Mine will usually stay in one area quite nicely now, as long as they have more spots to dig. If they're in a narrow space like a vein that has been marked for digging with digv, they'll often end up with nothing they can dig at the moment where they are and run to another part of the vein. But in wide open spaces they always seem to go for the nearest designated tile.
You also can have problems when you have more miners than the working face is wide. If you have 3 miners and you designate a 2-wide tunnel, 2 miners will start, and as soon as one tile is removed, now there is space for 3, so the third will dig a tile, and now one of the others has no space, so it heads off to dig somewhere else, then you end up with 3 spaces available in the tunnel for a moment, so that one comes back, and someone else ends up squeezed out. Having too many miners can actually end up being counterproductive at times.
Where I see them running back and forth the most is when I have two tunnels designated on top of each other at the same priority. They'll dig a spot or two on one level, then decide that the spot on the level below is closer since they rate closeness by x,y,z straight line distance. So they'll run down stairs and dig a couple of spots, and note the spot directly above them is closer and run back upstairs. The way to avoid this is to designate the digging at different priorities. Make one floor priority 4 and the other priority 5, and they'll do all the 4s before moving on to the 5s.