The main purpose behind keeping the dialogue consistent in Roald Dahl's "Lamb to the Slaughter" is to attempt an objective and biased- free account of what went on in Mary Maloney's house.
Roald Dahl uses the reader as some form of coincidental witnesses. All we can do is follow the action, deduct, and assume what will happen next to Mary.
Furthermore, Mary's talk provides her with alibis that she may use later. For example, as she talks to the officers she mentions her visit to the butcher. While at the butcher, she mentions more information that would place her away from the time and place of the murder.
Hence, we can conclude that Mary's dialogue allows her to protect herself, helps the reader make connections, and allows for the storyline to flow with more thrill.