Having a character who has to make similar decisions to Hamlet or Rosalind is just good writing. That's what we do. "Good writers borrow, great writers steal" - unattributed quote.
So what needs to happen in order for something to be proven as plagiarism? First it has to be recognized as substantively similar in tone, wording and verbiage to something else that was published prior, and then someone has to get upset about it.
Of course we're going to have bits and pieces of the craft floating around in our brains. Part of being a good author is reading everything. I've read so many things that sometimes I'll be talking with acquaintances, colleagues and friends and a plot will come up. I'll say how funny that is since I have a very similar plot in my idea file. I'll then expound on the plot for a while, only to realize that it's actually from a book I read in high school.
The probability that if one of those ideas were to make it past the vetting stage and into production my work would be similar enough to the original ithat someone would comment is very low. (Unless that comment is the ever vaunted "So and such is reminiscent of so and such" that you see on so many novels these days. I mean, really. Jim Butcher and Laurel K. Hamilton? Well, I guess they both have vampire sex in their novels about detectives, so obviously they're linked). It's just not how plagiarism typically functions. A plagiarist sits down, copies a passage from another work, changes it just enough that the verbiage isn't exact and then moves on. A nod, reference, homage, or shout-out studies the work they seek to set themselves in conversation with, and then reproduces an element: tone, style, punctuation, formatting, etc.,. The author making a reference or paying homage wishes for their work to be easily reminiscent of another's work. The plagiarist does not. The plagiarist wants to pass the hard work of someone else off as their own.
P.S. Toothpaste, I'm having a total geek girl moment. I just picked your book up from the library for "read widely" research purposes. That is all. Continue with your regularly scheduled program <ducks out>