Picking is pretty simple in principle: either select_all is true, in which case it uses all instances, or if it's false then it uses the instances in the SOL list. However the implementation details of this tend to be tricky.
Note you can only pick instances of the same object type or those which are referenced in object parameters - the event system does really important optimisations based on this assumption, but it means it won't work if you pick anything else. I'd also strongly recommend you don't pick anything outside of conditions, since it contradicts what the rest of C2 does. Ideally plugins can just stick to normal triggers and normal conditions.