Did you know Dill was modeled on Truman Capote, who was a cousin of Harper Lee? Just a trivia tidbit, that. I think Dill served several purposes in the narrative. For one, he was a sort-of outsider to the town during 3 seasons of each year, but he was on-scene when the big action took place. He functioned as a sort of catalyst, ramping up the drama for Jem and Scout. They knew the legends about Boo Radley, but may not have thought to actually attempt to interact with Boo had it not been for Dill’s urgings. This brings them to lonely Boo’s attention and in the end of the book is what saves their lives when Boo defends them against Bob Ewell’s attack.
Dill is also a tiny satirical commentator on the ways of the people of Maycomb, from his closet-alcoholic Aunt Rachel to everyone at Tom Robinson’s trial. Aunt Alexandra even chides him for being cynical and Dill responds “Telling the truth’s not cynical,” to which Aunty says, “The way you tell it, it is.” Dill is also the one who says when he grows up he is going to be a different kind of circus clown and laugh at the audience.
Dill provides a “romantic” interest for Scout that balances a little of her tomboyishness as well.
Sheriff Tate was out of town when the gang tries to lynch Tom because some of the mob “called him off on a snipe hunt,” i.e. lured him away deliberately with some scheme so he would not be there and the lynchers would have an easier time of it.
I think Atticus, strong as he was in the ways of the law, might have had a little weakness when it came to his sister, who had an iron will.

I find it interesting that Alexandra like every character is multi-dimensional. She fits in well enough with the gossipy Missionary Society ladies and she seems reluctant to embrace the same views about justice for Tom Robinson as Atticus does, at least not wholeheartedly.
She tries to change Scout into her version of what Scout should be as an about-to-be budding Southern lady (with mixed success) but at the end of the book we see her handing Scout the overalls to put on instead of a dress. I think she balances the book with another strong female character, and also she’s a work-in-progress - she has come from the background of how things were in the Old South, yet she is capable of opening her mind to different ways of thinking.