I've been working on this plugin for a couple of days, and am now messing with the SOL, so that I can return the objects that obey the condition, as would be expected of a plugin of this nature.
In the example, there are three objects. When they enter the arc, they are selected, and the ones who didn't enter the arc are not selected (as expected).
However, when they enter the arc and then leave, if one object stays within the arc, objects that were selected remain selected, even if they are outside the arc - in other words, as long as at least one object stays in the firing arc, the other objects can't be deselected when they leave!
I don't know what the problem is - my "check between angle" and "check within range" functions are OK, so the problem has to be somewhere else
I know my code is a horrible mess and I probably did things in a crazy inefficient way, so forgive me for that.
Example file with behavior: http://www.sigsonic.com/turret.zip
Live preview courtesy of DropBox
This is not fully functional yet, so some options are missing or might not work.