Also, some potential issues you might want to look into. I haven't verified these directly, so some of these could be non-issues. I am currently working on updating Lonely Shock to work in a similar fashion for removing EXP traps, since being able to find all the EXP traps in the map was the final puzzle piece that forced me to do it manually, so my code now does some similar things to yours, and I have run into these issues so you might want to check them as well:
- CM's can be randomised into any container, including hackable crates. Are you sure you want to lock some CMs behind hacking? Hackable containers have a script on their archetypes, but I think your script check only checks the concrete itself, not the archetype, because it's using PossessedSimple?
- CM's can be randomised into body bags. This isn't a bug or anything, but in the vanilla game they only ever put hypos or nanites in body bags, so it might feel a bit weird for players. You might want to skip them.
- There's an experience trap in hydro1, which is supposed to conditionally give you the 17 CMs from Polito's email about researching Toxin A, if you haven't already received the email in hydro2. From what I can tell, you're not handling this case, so the player is getting the extra 17 CM's twice, once in hydro1 and again in hydro2. You can invalidate it by using -Link 1351 1350 "~SwitchLink" since you're checking for SwitchLinks on each experience trap. The same thing happens in ops, which will give the player a whopping 65 bonus cyber modules (25 exp "deck completion" trap is counted 3 times instead of once, 15 exp trap is counted 3 times instead of twice).