If you just want to pick the closest enemy then:
Enemy: pick closest to (player.x, player.y)
Or if you want to pick all the enemies within a certain distance of the player:
System: pick by comparison: enemy: distance(enemy.x,enemy.y,player.x,player.y)<100
I personally wouldn’t want to touch any code that ai generates. Mainly because debugging is hard and time consuming. I find it easier to try to understand what I code as I go so I’m able to fix things as I go. I have no way of verifying how correct, robust or bug free a piece of ai code is without dissecting it which sounds like an annoying waste of time.