Basically what Tyb said, just keep checking for new items on your last target's coordinate. Possibly especially taking note of items on a dying target's coord (is there a DeathListener or something? I seem to remember seeing one).
I think you could also just add a chatbox listener to keep an eye out for "You can't pick this up you're an ironman" or whatever the exact message is (note it might be different for iron "women" accounts). And then a simple implementation would be to just blacklist the last item clicked on that coord, or even that coord overall until the items disappear. That way if it ever gets confused, it'll fix itself