a general comment on service design: the service callback should be idempotent(https://nso-docs.cisco.com/guides/development/core-concepts/implementing-services#ch_services.fastmap), the complex computing function in your service callback makes me wo...
I can't reproduce your observation that "the package operates also on devices with NED ids not included in package-meta-data.xml supported-ned-id tags", if I have:
1 2 versions of the same ned loaded, let's say 1.0 and 1.1
2 a template with no <?if-...
now I'm not sure what the question really is... do you want to be able to load the service package? or do you want to know why having <supported-ned-id> in package-meta-data.xml gave you "no effect"?
can you try putting the "permit" tag in a <?if-ned-id?> block? see https://cisco-tailf.gitbook.io/nso-docs/guides/development/core-concepts/templates#ch_templates.xml_instructions
as documented in
https://cisco-tailf.gitbook.io/nso-docs/guides/development/advanced-development/developing-services/services-deep-dive#ch_svcref.caveats, nso doesn't guarantee in what order services are invoked in a transaction.
and given that esse...