While this thread is several months old, I have recently come across it and decided to test this myself. I had set up a map section with a single gold block with a treasury that is 4 tiles away east but with a wall of solid rock resulting in a long walk to it and a treasury 8 tiles to the south but unimpeded; the Dungeon Heart was 11 tiles away to the south-east. From my testing methodology over several tries the imps would consistently attempt to drop off gold at the treasury that is 4 tiles away geographically from their position and completely ignored the treasury 8 unimpeded tiles away; I did not observe them dropping off gold at the DH. The journey to the 4 tile treasury is substantially longer (about 40 tiles walk) than to the 8 tile one. It seems that imps will prioritize gold drop-off points that are the fewest map blocks away from where they were mining regardless of obstructions or the length they would have to walk to reach said drop-off.
There is more testing that can go into this but from my quick testing and analysis this bug did not exist. I was using GOG 1.7 by the way.