Multi-Z level pathing isn't done properly yet. They calculate distances based on the assumption that they can float right through any floor or ceiling. Increased costs for z-level pathing might become a thing later since tiles are canonically taller than they are wide (by a 3:2 ratio, IIRC.)
Adding an extra cost to Z-level movement could be done in any of three places: The initial goal choice, the cost function, or the heuristic function. The cost function is the one that already handles each tile's traffic value; adding 1 when the Z-level changes should be simple, but on its own would slow down pathfinding. Switching the heuristic function to assume a movement cost of the normal traffic designation per tile would speed up pathfinding, particularly if it also assumed extra for Z-level differences. Switching the initial goal choice might also speed things up, and would definitely trim down weirdness, but might not be as important given my next idea:
There is not really any notion of "proper" or "improper" to the way it is done now, as far as I can see. In the case of multiple possible goals, you can't use actual paths to determine the goal of the pathfinding operation prior to finding the path: that's circular. Thus, your only two options are:
1) Choose the goal by some shortcut method that inherently cannot take into account exact paths by the very nature of it being the STARTING point for a pathing algorithm. This is the current model. OR
2) Just do a blind flood algorithm until you hit one of the valid goals. This would make everything based on natural paths, but it would also be way the hell slower.
Which one is "proper" depends entirely on the value you place on speed versus weirdness, which is subjective.
It seems like there could be a hybrid option, though, which might even be faster in the general case.
Step 1) Find a set of goal spaces.
Step 2) Choose the closest one, as the ghost flies.
Step 3) Path using the heuristic for the chosen one, but stop as soon as
any goal space is found.
Checking whether each node is a goal space would slow down pathfinding, except that the shortcut would speed it up, sometimes dramatically. For example, I once watched one dwarf carry another halfway down the map, through one hospital, up and down dozens of ramps, and through two cavern layers to get to another hospital that just happened to be directly below where the wounded dwarf was lying. I have since learned to build similar things directly underneath each other, but still wish I hadn't needed to.
There are still cases where this algorithm will choose a sub-optimal path, but they should be rare and far less obvious. I have considered a multi-destination heuristic to handle these cases, but that gets complicated, potentially slow, and possibly less effective than the blind flood fill.