In Explorers of Time/Darkness, when a Pokemon is released from the Chimecho assembly, the level is reduced to 0, which is the invalid bit. (The bit that you labeled isvalid in your code is always 0 in T/D.). I think, but have not tested, that the same applies in Explorers of Sky: the first bit means nothing and the level is the only thing that matters in this case.
Haven't seen anything for PkmnEx though; putting a Pokemon in standby changes some unknown data just before the name. (Time/Darkness again)