I just tried these situations:

Animating a closet is fine because it's mimic containing a closet containing a mob
Animating a pAI is fine because the actual mob isn't contained in the pAI at all, it's an invisible mob on top that follows it
Animating an occupied soulstone is fine because it's a mimic containing a soulstone containing a mob
Animating an AI is fine because it's a mimic containing a intellicard containing a mob
Animating a brain or MMI is fine because the var brainmob is used to store the mob

As long as there is a buffer of something between the mimic and the mob that code will not run and there's nothing in game currently that I can think of that would cause one of these items to be destroyed in such a way that wouldn't also destroy the mob within.

Note that there is a preexisting bug outside this commit with animating a closet containing a mob in that the closet will not have an atmosphere while in the mimic. This would affect people in animated statues too if it wasn't for the fact that the code specifically shields them from damage anyways (because it wouldn't make sense to have a flesh to stone spell wear off to find that the mob had been burned to death in a fire or frozen from space while being a rock).

Also the animated occupied pAI tried to attack the invisible mob on top of it, but couldn't, again this is a preexisting bug outside any changes made in this commit