Sorry for not beeing able to enbed the pictures, but I'm on a new phone.
The condition clearly state:
if enemy carrying resource in short or middle range from me, AND not at short or middle range from closest enemy exists
>> Move toward closest enemy carrying resource
>> bla bla bla
As you can see from the pictures, the enemy carrying resource is way closer than middle range from closer enemy, so why is my SG moving toward it?