It just occurred to me that this might be an opportune time to fix a longstanding (and hugely annoying) bug. The function that calculates straight-line distance for job items ignores z-levels. Here are a couple reports that include simple ways to reproduce the problem: one, two, three. It should be a quintessential one-minute fix, but I know how that goes.
I don't see it as being a trivial fix, because there is a tradeoff between accuracy and speed. The obvious options would be to use full pathfinding (slow), or assign a penalty for each z-level (breaks vertically designed fortresses depending on the penalty).
I'm not about to post on very old threads, but if I was trying for a quick fix, here's two options I'd consider:
(1) (quick and dirty) A fixed penalty for each z-level difference. No more than 2-3 per z level (otherwise vertical forts get broken - I always have many z-level spanning stairs right next to my workshops) or (best option) have a Z_LEVEL_MATERIAL_SEARCH_PENALTY value in the init.txt file (default it to 2 or 3).
(2) (nicer, but longer to implement). Instead of using the full pathing algorithm, do a depth first flood fill on the fortress which should usually terminate very quickly if just looking for 1-3 items (which is when this gets used), and possibly have a cutoff (say a distance of 10 or 15 or settable in init.txt, or have 'filled' a certain number of points) where it goes back to a simpler calculation cases, in which case you already have a distance d you have checked to, so any item is at least d+1 away. As a nice bonus, the flood fill could store enough information (each square stores which direction it got filled from) that it provides a path for the dwarf (if the dwarf is already at the workshop - a common case), and a tentative path back, and full pathing doesn't need to get used at all (unless the geometry changes).
Some sort of full pathing already gets used when picking an item to construct something (say a new workshop), but I suppose that the hit there is hidden by the fact that it is a user interface driven action anyway.