The significance and function of music in the play is to aid concentration and also to exercise the demons that may inhibit the concentration involved in decision making.
The theme of the conversations between Portia and Nerissa are about light and darkness, and music. Portia says that like a small candle shines brighter when it is dark, a good deed stands out more in a bad world. Nerissa comments that “When the moon shone we did not see the candle” meaning that in a good world individual good deeds do not stand out as much. These are followed by a conversation about the rings. The fact that Bassanio picks up on one of the themes illustrates that he is on the same wavelength as Portia and is therefore well suited to her. In her quibbling response to Bassanio, Portia seems seriously devoted to Bassanio.
Nerissa demands that Gratiano show her the ring he gave away to Portia's "clerk" in Venice. They start to argue over it, with Gratiano defending his action as a form of kindness for Antonio. Nerissa’s objection to Gratiano’s having given her ring away is the fact that the gift of the ring serves to represent the sanctity and holy promise of the marriage. Thus, for Gratiano, and indeed Bassanio, to give away the rings is a violation of their marriage contract, a sign that they love Antonio more than their wives. Since this cannot be allowed, Portia uses her ring trick to force Bassanio to give up Antonio. The joke that Portia creates in her speech is when she says, "I'll have that doctor for my bedfellow" ll.232, thus implying that Bassanio needs to realise the ring is given to him alone, and that giving it away violates the relationship implicit in their marriage contract. The idea of sworn oaths represents a crucial part of the play. For example, the whole basis of the casket subplot revolves around sworn oaths. Each contender must swear never to marry again if he chooses incorrectly and must also swear not to tell anyone else what colour casket they chose.
Portia’s criticism of Bassanio’s trustworthiness, where she tells him, “so void is your false heart of truth” is perfectly just considering that he has broken a promise that he made to her. The ninefold repetition of the word ‘ring’ in the next two speeches is to emphasise the importance trust represents if the relationship is to be a successful one. It is ironic that the Doctor who Bassanio is telling Portia about was Portia in disguise. It is also ironic that she tells Bassanio he will have to watch her “like Argus” in case she is unfaithful or deceives him. Apart from the humour of the situation in Portia’s speech in ll.223-233 the significance of her speech in the play as a whole is that by the end of it, no-one’s honour is “yet mine own” i.e. intact except maybe her’s even though she has illegally appeared in court. The insistence on the word “double” in Portia’s speech in not fully justifiable considering the fact that she has deliberately set out to trick Bassanio on the issue of the rings.
In ll258-262 Portia and Nerissa tell Bassanio and Gratiano that they managed to retrieve the rings from the doctor and his clerk. Bassanio looks at the ring and recognises it as being the same ring he gave away. Portia then tells him that the doctor came back to Belmont and slept with her. Bassanio is amazed and does not know how to respond. Portia finally clears up the confusion by informing Bassanio that she and Nerissa were the doctor and the clerk Gratiano responds by saying that the situation is ridiculous, and that there is no point in the ladies interrogating them any longer if they have the rings.
I find the news Portia gives Antonio convincing. I believe it is not intended to give the play a happy ending, but rather to add to Antonio's defeat, by handing him his money and ships at the end, then essentially telling him to return to Venice and forget about Bassanio. This is in a sense a rather comical occurrence, and so to that extent is in harmony with the comic ending provided by the play ending with the three pairs of lovers.
Lorenzo and Jessica do not really deserve the gift that Nerissa reveals to them considering how disrespectful they have been towards Shylock. However, from the point of view that they have been more loyal to one another than the other lovers they are deserving of the gifts.
The play is given a rather silly, happy ending with Gratiano having the final words. This is in keeping with Shakespeare’s intention for it to be a comedy.