The same logic was duplicated in two places, now factorize it into its own function. This code reads (peeks) _some_ ID info from a blendfile, without actually reading the full ID data. And it also decides if the given ID BHead should retained, or skipped. This is mainly used to show a list of available IDs or assets to link or append.