It could be argued that CJ saved Madd Dogg's life out of guilt just as much as his will to do the right thing. CJ always knew that stealing this rhyme book was morally wrong, but much like his other activities, this is justified by his upbringing, the hood life and the status quo. From the perspective shown at the beginning of the story, CJ (and the GSF by extension) are pushed down, whilst big-time stars live it up in houses on hills, simply for doing what they do. CJ knows OG Loc lacks the lyrical style to make it big but at this point he's thinking of his own, and how he deserves every bit of success MD has. Thus, he steals the book.
CJ then goes on a journey of sorts - not only is he sent four times across the state and back again, but he's shown what it really means to be loyal and who is most important to him. He is taught a lesson in empathy. It isn't until the GSF falls apart and CJ realises the value of hard work and "honesty" that he does his best to put things right, and this includes righting the wrong done to Madd Dogg.
I put "honesty" like that because obviously there's blurred lines here. Does CJ come clean about stealing the book in the first place? Likely not, as we aren't shown this and and admission of the crime would likely put strain on his new-found relationship with Madd Dogg. CJ lets Madd Dogg believe it was OG Loc because he feels he is merely the middle man, the lapdog who did the running around and dirty work for those who would use him time and time again to get ahead.