Mary's behavior depends on which part of the story you are referring to.
When the story begins, Dahl describes Mary's behavior as an example of what an over-the-top doting wife might behave like. Mary worships the very ground that Patrick walks upon. She excitedly waits for him to get home. She serves him his drink when he enters the house, and she doesn't want him to have to get up to get another.
"She merely wanted to satisfy herself that each minute that went by made it nearer the time when he would come home. . . He got up and went slowly to get himself another drink. "I'll get it!" she cried, jumping up."
Mary Maloney is essentially one of the Stepford Wives.
After Patrick tells Mary that he is leaving her, Mary's behavior changes. She operates as if she is in a daze. She's on automatic.
"Her first instinct was not to believe any of it. She thought that perhaps she'd imagined the whole thing. Perhaps, if she acted as though she had not heard him, she would find out that none of it had ever happened. "I'll fix some supper," she whispered. When she walked across the room, she couldn't feel her feet touching the floor. She couldn't feel anything except a slight sickness. She did everything without thinking. She went downstairs to the freezer and took hold of the first object she found."
Mary is in her dazed state until Patrick's dead body hits the floor. Then Mary comes to and starts operating with cold, hard logic.
"The violence of the crash, the noise, the small table overturning, helped to bring her out of the shock. She came out slowly, feeling cold and surprised, and she stood for a few minutes, looking at the body, still holding the piece of meat tightly with both hands. All right, she told herself. So I've killed him. It was extraordinary, now, how clear her mind became all of a sudden. She began thinking very fast."
Her mind is clear, and her actions are deliberate. She sets a plan in motion that gives her an alibi and gets rid of the murder weapon. And at the end of the day, Mary has successfully gotten away with killing her husband.