There are many literary devices employed by Richard Matheson in his novel I Am Legend.
After a while, though, even the deepest sorrow faltered, even the most penetrating despair lost its scalpel edge.
This quote is an example of a metaphor. A metaphor is the comparison of two dissimilar things with similar characteristics, as if they were the same thing. Sorrow and a scalpel are being compared here. They are not the same thing, but share the similar characteristic of causing sharp pain. Sorrow also cannot "falter." This is a human characteristic.
Another metaphor is:
Let the jagged edge of sobriety be now dulled.
The next quote refers to the theme of loneliness.
He had such a terrible yearning to love something again, and the dog was such a beautiful ugly dog.
"Beautiful ugly dog" is a paradox. A paradox is a statement that at first seems self-contradictory and untrue. One wonders how a beautiful dog could also be ugly. The truth in this description is found in Neville's desire to love again. He has lost everyone and is totally alone. The dog may be a mangy mutt, but he can also be beautiful because he represents the potential not only of companionship, but also of possibly loving something again.
The next literary device is personification. This literary device gives human characteristics to non-human things.
A new terror born in death...
"Terror" cannot be born. Birth is a human characteristic that cannot be literally applied to inanimate objects or [abstract] ideas.
The following quote is also an example of personification:
And, before science had caught up with the legend, the legend had swallowed science and everything.
Finally, the last quote is an example of a simile. A simile is very much like a metaphor. A simile is the comparison of two dissimilar things with similar characteristics, as if they were the same thing, using "like" or "as."
No, by God, he had no intention of going on like a blind man, plodding down a path of brainless, fruitless existence until old age or accident took him.