Dr., your question is well taken. I believe that Hagen was too intelligent not to have believed that Michael would have whacked him for cause, for the reasons you said. If Michael ordered his own blood relative brother killed, what would exempt Hagen? And, given Michael's ruthlessness, Fredo's killing might very well have served as a warning to Hagen and everyone else close to him (including Rocco, Neri and Connie): No one's safe, no one's exempt.
In fact, at the end of the novel, Michael sends Hagen to visit Kay in New Hampshire, where she's fled with the kids after the Great Massacre of 1955. Hagen confides some things to her and says something to the effect (I don't have the novel in front of me): If Michael knew I told you this, I'd be a dead man.


Ntra la porta tua lu sangu � sparsu,
E nun me mporta si ce muoru accisu...
E s'iddu muoru e vaju mparadisu
Si nun ce truovo a ttia, mancu ce trasu.