You may try to add SCAN_LIMIT in your c_scan mode list to find those
entities with ENABLE_SCAN is on.
Code:
function scanEvent()
{
if (event_type == event_scan)
{
my.enable_scan = off; // scanner will ignore me. But then again
// you need to find a way to re-enable it again
}
}
action scanEntity
{
my.enable_scan = on;
my.event = scanEvent;
}