For a big part of this book, Slartibartfast has two very simple roles:
(1) He's the Magrathean planet designer who tells Arthur all about the real story of Earth, including all the details about Deep Thought, the mice, the fight between the philosophers and the programmers, all those fjords, and so on. For five chapters (24-28), Slartibartfast takes on the guide role that Ford and the Hitchhiker's Guide have for the rest of the book. (Poor Ford, really—first he gets stranded on Earth, then for five chapters, his role gets taken by someone else.)
(2) He has a silly-sounding name.
(3) Wait, we only said he had two roles, so what's this third one doing here? Well, at the end of the book, after he introduces Arthur to the mice who want his brain, Slartibartfast adds an additional plot role when he helps Arthur and his friends escape. When Arthur and friends come out of the meeting room, they discover "several rather ugly men who had been hit about the head with some heavy design awards" (32.13)—probably the award Slartibartfast got for Norway's fjords (24.36)—and then Slartibartfast's aircar with a note from the good funny-named chap himself (33.37).
Now, this doesn't make Slartibartfast a hero. We don't know why Slartibartfast is helping Arthur, though it seems likely that it's because he's angry at the mice. After all, when they say they won't need the new Earth, Slartibartfast is "aghast" (31.38), which is never a good thing to be. When the mice suggest he take a skiing holiday on his glaciers instead of making fjords, he almost blows his top, saying that "It would be sacrilege to go skiing on high art!" (31.40). There's no love lost between Slartibartfast and these fine specimens of Mus musculus.
(4) Okay, so as we said, Slartibartfast has four roles in the book. Thematically, Slartibartfast makes a nice contrast with the mice. That is, the mice and the programmers are all interested (at first) in big issues—what does life mean, why are we here, blah blah philosophy blah. (Don't get us wrong: we love philosophy, but the philosophers in this book are pretty blah.) In other words, the mice (at first) are interested in getting rid of the absurdity of life.
By contrast, Slartibartfast is interested in the little things and in being happy rather than worrying about the big things. As he says to Arthur, "I'd far rather be happy than right any day" (30.11). He doesn't care about absurdity; he just wants to be the opposite of sad. Of course, he then adds that he's not happy in any way, so chew on that. All we can say is that if the mice aren't so happy looking for the meaning of life, and Slartibartfast isn't happy not looking for the meaning of life, then happiness might be the rarest commodity in this book.
Does happiness lie somewhere in between? Maybe Arthur can tell us that if he gets a moment at the Restaurant at the End of the World.