I always thought the Little House books were a disguised morality play - for instance, be an obnoxiously perfect person and go blind, be obnoxiously self-righteous and have small children chant nasty rhymes at you, be lazy and freeze to death in a blizzard... all they need is a reference to 'Matilda, Who Told Lies and Was Burned to Death" and they're complete.
I never thought Mary was obnoxious.... I just didn't like her as much as Laura.
But you might be right. In hindsight.. there can be a lesson in anything, and maybe she was thinking that when she was writing. :~D