I've kind of figured this out, but I wanted to get some discussion going on some of the bugs we have to deal with when making things like portable containers, because I've just discovered some I've never seen mentioned before. I've been working on a combo alchemy sorter/portable container, and been finding lots of new ways to screw those two things up.
1. A container won't let a targeted script activate it unless the container itself has a script on it. All it needs is this:
If ( OnActivate ) ActivateEndif
That's it. Without it the container won't open via script at all. I found this out by trying to open an unscripted container with another script and nothing happened. After I added that seemingly pointless script to the container, the calling script worked. I've never heard of this bug before. Anyone else run into it?
2. A container must be manually activated before it will let a targeted script activate it. Always. This one's pretty well known (though I don't remember it mentioned in MWSFD). Also related to the 72-hour bug, meaning containers have to be re-activated manually after a reload.
3. Checking the contents of a container via targeted script, after reload or the 72-hour cleanup, can make the game crash. I found this out because I'm using a container I don't want scaled up for reload detection. I thought since I put a light in there as a fake inventory item (for another script that adds/removes items) I could repurpose that as reload detection instead of setscale. Nope! Using GetItemCount on a container after reload (even in the same cell!) made the game crash, but only after I added the script to the container. It worked fine on an unscripted container though, for reasons unfathomable to mer or man.
4. Since setscale seems to be the only reliable way to check if a container needs reloading, when using a mesh you don't want to resize, you have to come up with a hidden object to resize in its place (please let me know if you can think of a better option).
5. You can add or remove items on a 72-hour bugged container with a targeted script, but you still can't open the damned thing with the same script until you've opened it manually. I haven't yet tried a script for sorting ingredients while outside the same cell as the container. I'll report back with all new bugs after I do, I'm sure.