I don't want to do that. I want the AI to handle system and station defense stuff. It was doing it fine until I stupidly accepted this mission to harass this neighbor empire. All i want to do is stop it from being fixated with this neighbor and stop sending ships to attack them.
What I do for automated system and station defense is I create a small fleet of vessels (perhaps four frigates), assign the fleet a home base in the system I want to protect, set the stance to defensive and engagement range to system (these can be set using buttons under the fleet details in the lower-left corner of the screen), and automate the fleet. If done correctly, the fleet should never leave the system unless there's no fuel within the system or its home base is lost or destroyed, and it should engage threats within the region covered by its engagement range. You can use the other engagement range settings if you desire.
I've had to intercept six escorts heading the this wretched system no and tell them to go home - they just refuel and head straight back again.
What mission are the escorts on when they're heading to this system? In the ship detail in the lower-left corner of the screen, does it say something along the lines of 'attacking mining station,' or does it say 'escorting (some random name)' - if the latter, then you have at least one civilian freighter of some kind in the system, and the computer has decided to send your automated escort over to give some extra protection to that freighter. If the former, then I cannot really help you aside from perhaps suggesting that you stick all of your escorts in one giant fleet on defensive stance and engage anywhere, as that might prevent the escorts from being used offensively.
Be aware that the computer will assign escort missions with no regard for keeping warships out of the territory of other nations; offending other empires by having warships visit their space is a risk you must accept if you want to make use of unsupervised, unlimited engagement range, automated ships and fleets.