If your only looking for anchored objects you can find them with a grep and then you'll only have to deal with them.
There are post here on finding them.
app.findGrepPreferences.findWhat = "~a";
Thanks Trevor, but how to find only the anchored objects that overlaps instead of finding all anchored objects and checking whether they overlap with any other anchored objects.
You can't do that.
What you need to depends on the doc setup.
typically you will need to fetch all the objects with the grep and then map each object to the spread it is on. Then you only need to compare object on the same spread and that should go quickly