Maybe her soul just filled Sans' body faster? Maybe she somehow knew... nah, that's enough tin-foil hat theories for now. Also, just a note... imagine Sans' dodging skills with Undyne's raw power... now imagine trying to fight that in any kind of run.