Sort lists by proximity

Hi Nick,
I think I got what I needed from this post:

I need to copy z coordinates from a list to another list based on the shortest distance.