Melissa Perez, 46, swung a hammer in their direction and appeared to be in distress in her home when the officers arrived, officials said.