The patch itself appears to be sound, just some points of style that are bothering me before I put this in trunk.
Regarding lines 187-189 of the patch. The design of
evaluate_ship_as_closest_target is a very common idiom in the FSO code base. I also agree that it makes learning the code hard and can hide and/or introduce bugs into other code. However because the idiom is so common in the code base you do get used to it (as much of a cop out as that sounds).
Okay, now to pick on the style:
Hard wrap your lines at 80 chars (that is, use the enter key to wrap the lines). I have a 19in monitor and some of them still run off the the screen when my diff viewer is full screen, I shudder to think what would happen in the the tiny window for code that results when debugging.
If you don't know how to set your favourite editor to at least show a line at 80 columns I am sure one of us SCPers (or google) would be able to help you. If your favourite editor cannot show a line at 80 columns, I suggest you get a better editor.
Please fix the extraneous whitespace (and inconsistent use of whitespace) for examples:
- Chunk starting on line 5
- Chunk starting on line 13
- The code block that starts on line 21 introduces a number of whitespace errors (tabs or spaces without non-whitespace after them)
- Why is the comment indented? line 26-36
- whitespace after the colons on line 55 (not counting that they should be wrapped at 80 columns)
- there should be no whitespace inside [] on line 56
- Chunk starting on line 213
- Why are the comments indented on line 362
- if you are going to move code, fix the whitespace at the same time 361-373
Personally I am not a fan of littering names all over the code because it implies ownership of the code. However, it is rather common in our code base, but it is put at the end of the comment not the beginning.
Finally, you haven't included a commit message.

Preferably a <60 char summary or a <60 char summary with a longer explanation after.