Implementing either method would take roughly the same amount of work.
First you need an array.
char *Turret_order_names[NUM_TURRET_ORDER_TYPES] = {
"Bombs",
"Ships",
"Asteroids",
};
For each turret(ship? ship class? turret on a ship class?) you'd add another array:
int targeting_priority[NUM_TURRET_ORDER_TYPES];
Then in get_nearest_enemy_objnum():
for(int i = 0; i < NUM_TURRET_ORDER_TYPES; i++)
{
switch(targeting_priority[i])
{
case -1:
//Empty priority slot
break;
case 0:
//Return if a bomb is found
//...
case 1:
//Return if a ship is found
//...
case 2:
//Return if an asteroid is found
//...
default:
Int3(); //Means invalid number passed.
}
}
Then you just need to add the SEXP, which is time-consuming but not really hard. Essentially what the code will do then is iterate through the array, which stores a series of numbers that correspond to each target type. When it hits the number corresponding to a type, then it'll target that object if one of that type exists.
The array above would be used for translating the numbers into human-readable strings in the SEXP (and vice-versa) by the order.
Dynamic order rather than simple priority actually results in a simpler code sequence because you don't need new functions or more if() checks (or, Goob forbid, gotos).
So, what basis would this be on?