Ditto on the "night terrors" Toddler's get into a trance where they aren't really awake and dont respond well to directions... seen it in mine quite a few times! Other times she will try to talk and act like she is awake... as soon as I put her back in bed she instantly falls back to sleep. Agree on the 400bpm is too fast to calculate. It would be 15 secs x 4 to get bpm...yes The screaming usually leads to the coughing spells so I wouldn't think anything of it.
Some toddlers have "night terrors", kind of a walking nightmare state. My oldest son went through that for awhile. Not sure what triggers it. And an excited state like that could increase heart rate. But trying to count out 400 bpm is pretty difficult. Even over 200 bpm is getting tricky. This is something you should mention to her pediatrician, make sure there's nothing else going on in her health.