Outside of damage events, sensors and collisions it's not possible to infer the types of detected object or avatar.
I'd like to see an OBJECT_TYPE that returns the integer mask just like llDetectedType does.
It was realised because DAMAGEABLE can't necessarily be inferred through OBJECT_HEALTH. DAMAGEABLE is when an object can process damage but health could be 0, such as when it is dead and respawning, potentially causing a false negative as it can't be used as a boolean check.
This is a low priority request personally but it might be low hanging fruit if it's easy to implement simulator side.