Filch's dungeon of choice, as it turned out, was a tremendously awful, horrible, and dreadful place to spend any length of time. Especially after what he'd experienced in the Carrow's office. Ernie couldn't even think about articulating how awful he felt, and he had no idea how awful he looked. He just walked, almost in a daze with no real recognition of where he was going or who he passed on the way, his feet taking him back to the Hufflepuff common room.
If his mind had been working, he might have gone straight to the hospital wing, or maybe even the prefect's bathroom to try and clean up to some degree, but his mind was completely numb, his body still in a tremendous amount of pain.
Once he reached the common room, he found himself collapsing on the nearest couch, unable to walk himself any farther. He was rather oblivious to whether or not anyone else was around.