I agree with bmadnick's answer, but would like to add my thoughts on the subject. When Margaret is discussing Hero's wedding attire, she says that Hero should wear a certain "rabato," or lace ruff, that would be better, more fashionable. Hero says no, that she will wear the one she originally chose. Margaret reminds her that her cousin, Beatrice, will also agree with Margaret on her choice, to which Hero responds that Margaret is a "fool" and so is Beatrice. This doesn't seem to upset Margaret, as she goes on to describe the gown the Duchess of Milan wore, which was apparently the height of fashion - but which, according to Margaret, simply does NOT compare to Hero's!
Margaret is very street-smart. I think she knows how to work people, is clearly up for some fun sport (both verbal and otherwise), and is far more worldly than either Hero or Beatrice (thus making her a foil for them, esp. Hero). I also believe her to be loyal to Hero. She wasn't at the wedding for whatever reason (Shakespeare didn't put her in the wedding, so I think we need to assume she was hung over, running late, or something...maybe even miffed about the rabato!), so she couldn't declare Hero's innocence after Claudio's accusations.
Once the truth comes out, Leonato forgives her for her part in Hero's disgrace. Borachio even defends her against possible punishment. She is clearly a popular girl!
Margaret is Hero's servant (lady-in-waiting) who is up on the latest fashions, especially with regard to wedding gowns. Hero likes her and trusts her, calling her "good Meg". When she helps Hero to dress for her wedding, she says all the right things about Hero's wedding dress. Another interesting characteristic of Margaret is her use of puns that have hidden sexual meanings. This reflects Margaret's mysterious behavior in the play. She pretended to be Hero the night she entertained Borachio at Hero's window, but when Hero is accused at her wedding of not being loyal, Margaret never says anything. In fact, she isn't even mentioned in the list of characters who are present at the wedding. She shows up again at the end of the play, however, among the dancers.