How does Shakespeare use sin and salvation to add depth and meaning to Hamlet?
I think that yes, Shakespeare does use sin and salvation to add depth of meaning to Hamlet.
One could use the character Claudius as an example of this concept. In Act III after the play The Mousetrap, Claudius goes attempts to pray and ask for forgiveness for the murder of his brother. Yet because he cannot truly repent, which would require his willingness to give up those things he has gained through sin, his prayers cannot be heard; therefore his sin remains with him and salvation is lost to him.
Another example might be found in Old Hamlet, the ghost. When he first speaks with Hamlet, he tells him that he was murdered with "no shriving time given." What this means is that he was not given his last rites or an opportuntiy to pray for forgiveness of his sins before his death. For that reason, he must spend some time in purgatory or hell until he has paid for his sins and can recieve salvation from them.
A third example might be Hamlet and Leartes. In the final scene, after Leartes has poisoned Hamlet and then been poisoned by his own sword in the scuffle, the two confess their "sins" and exchange forgiveness.
LAERTES: He is justly served.(335)
It is a poison temper'd by himself.
Exchange forgiveness with me, noble Hamlet.
Mine and my father's death come not upon thee,
Nor thine on me!
[Dies.]HAMLET: Heaven make thee free of it! I follow thee.
Though this is not exactly last rites, it is a confession and repentance before death. With it, one might presume that Hamlet and Leartes are candidates for salvation.
The repentance for sin is one thing differentiates Leartes and Hamlet from Claudius.
On a related topic, see the second link below for an enotes page that discusses the theme of redemption in Hamlet.