JT Walsh (Style and Structure in Biblical Hebrew Narrative, 2001) points out that Gen 37:36 and 39:1 form an inclusio for the record of Judah’s relationship with his daughter in law Tamar. This interruption in the story of Joseph may seem out of place, but the explanation is that Judah is key to the Joseph narrative. Judah is the one who suggests selling Joseph but much later he offers to become slave to Pharoah in order to save Benjamin. How did such a change of heart come about? Walsh says
“It is surely not irrelevant that Judah in the meantime was bereft of two sons (38:7-10). He learns through experience the grief Jacob felt at the loss of Joseph and can anticipate what Jacob would endure if he lost a second son“.
JP Fokkelman (“Genesis 37 and 38: Structural Analysis and Hermeneutics”, in “Literary Structure and Rhetorical Strategies in the Hebrew Bible”, 1996.) has published a ring composition for ch 38 and the following is a combination of both ideas with some minor tinkering on my part.
My suggestion is that the central dialogue has to do with evidence of family inheritance. Tamar wanted to continue the line of inheritance and so asks for a pledge to emphasis ultimately that Judah had broken his promise to her and couldn’t be trusted. The pledge asked for represented family inheritance – the signet (or Judah’s signature seal), the cord that was used to hang the seal around the neck , and the staff (the symbol of tribal affiliation, see Numbers 17:2).