So...I'm going to say probably coincidence, though there is some evidence in your favor. Thus I'll present the evidence first and then my own conclusion; do with it what you will.
Tolkien on Shakespeare
The evidence here is mixed, but I'll give a brief summary. Tolkien referred to
the shabby use made in Shakespeare of the coming of 'Great Birnam wood to high Dunsinane hill'
in his Letters. He felt that Shakespeare wrote elves very poorly (quote again from his Letters)
the word [elves] to be understood in its ancient meanings, which continued as late as Spenser—a murrain on Will Shakespeare and his damned cobwebs.
In On Fairy Stories he said that
To be dissolved, or to be degraded, is the likely fate of Fantasy when a dramatist tries to use it, even such a dramatist as Shakespeare
Is that last a positive reference to Shakespeare, or merely pointing to Shakespeare's lofty status in drama? Who knows. Nevertheless, he clearly thought that fantasy and drama did not mix.
In his Letters, Tolkien comments that in his schooldays he
disliked [Shakespeare] cordially
Though also in his Letters there is a passage which admires a stage performance of Hamlet (so he would at minimum have been aware of the passage you quote, especially as it is one of the more striking passages in Hamlet):
Plain news is on the airgraph; but the only event worth of talk was the performance of Hamlet which I had been to just before I wrote last. I was full of it then, but the cares of the world have soon wiped away the impression. But it emphasized more strongly than anything I have ever seen the folly of reading Shakespeare (and annotating him in the study), except as a concomitant of seeing his plays acted. It was a very good performance, with a young rather fierce Hamlet; it was played fast without cuts; and came out as a very exciting play. Could one only have seen it without ever having read it or knowing the plot, it would have been terrific. It was well produced except for a bit of bungling over the killing of Polonius. But to my surprise the part that came out as the most moving, almost intolerably so, was the one that in reading I always found a bore: the scene of mad Ophelia singing her snatches.
(Bolding of most relevant bits my own.) One writer notes
As a professor at Oxford, he often felt that too much attention was given in the English classroom to Shakespeare and felt that a balanced language and literature course should be “based on ancient and medieval texts” and should pay little attention to anything more modern than Geoffrey Chaucer.
Which is of course an interesting point. According to the Carpenter biography, as a teenager he delivered a speech in which he
poured a sudden flood of unqualified abuse upon Shakespeare, upon his filthy birthplace, his squalid surroundings, and his sordid character.
A thorough lambasting if there ever was one, though of course this was as a teenager.
The Ring and Man
The two passages refer to quite different objects - the One Ring, and man. At first glance, the passages seem almost in deep contrast in this sense - we see man being quoted as "noble", "admirable" - but we know that the Ring is in apparent contradiction a evil thing, even though it appears so beautiful - Frodo is thinking this after Gandalf explains the Ring's history to him, after all.
On the other hand, we know - Hamlet knows - that Man is just as depraved as the Ring. The Ring, after all, only accentuates the base desires of the one who wears it - Sam is notably least affected by the ring, because his desires are not for power, but for a nice garden, and for Frodo to be happy. Not much for the ring to work with. And indeed, while Man can appear powerful and wise, we see Hamlet's uncle murdering Hamlet's father, and Polonius, Rosencratz, Gildenstern, Ophelia going mad, Hamlet himself killing and scorning and hurting - who do we really look upon positively, when it gets down to it, in Hamlet? Horatio, maybe. The skull of Yorick.
The passage is from when Hamlet is "expressing his melancholy" (to quote the ever-faithful Wikipedia) and it shows in the later part of the passage you quoted:
what is this quintessence of dust? Man delights not me
So much for being the paragon of virtue. Similarly, think of who else in the Ring refers to it as beautiful - Isildur, in his writing says
It was hot when I first took it, hot as a glede, and my hand was scorched, so that I doubt if ever again I shall be free of the pain of it [...] it loseth neither its beauty nor its shape [...] of all the works of Sauron the only fair. It is precious to me, though I buy it with great pain.
And we know that in the end the Ring betrayed Isildur and let him die. So much for its apparent beauty. (We also see here the echo again of the word "precious" - like with Bilbo, Frodo, and Gollum, such that this is clearly to make a point.)
Your comparison of
how rich and beautiful was its colour, how perfect was its roundness. It was an admirable thing and altogether precious.
What a piece of work is man, How noble in reason, how infinite in faculty, In form and moving how express and admirable (...)
seems mostly focused on how they both praise the objects in question, and the sort of pattern of "how [phrase of praise]" (in other words, the use of parallelism here). However, I'll note that that structure is used only twice in Hamlet's whole soliloquy. Hamlet's soliloquy is also much longer than Frodo's aside here.
I've also, for the record, seen this sort of structure pop up before in other works, and while it may be indirectly from Hamlet through some sort of long descending "ooh, I like this writing! I'll use it!" chain that passed through both conscious and subconscious, it's small enough that it almost certainly isn't intentional.
Finally, I'll point to Rand al'Thor's great comment: "if it was an intentional Shakespeare reference, then surely Tolkien's passage would have been more similar: e.g. "how rich and beautiful in its colour, how perfect in its roundness". The fact that it's only half-similar suggests that Tolkien didn't have Hamlet in mind when writing it."
Intertextual comparison in the Lord of the Rings
Tolkien once said in his Letters (in one of the better quotes I've ever read) of intertextual comparison like this that it is
not very useful.
In particular, Tolkien for the most part based his story on, e.g., Beowulf, or Norse mythology, not more modern literature. To quote his Letters (for what it's worth, if you are at all interested in Tolkien scholarship, please promptly get a copy of the letters and Humphrey Carpenter's biography)
As for the rest of the tale it is [...] derived from (previously digested) epic, mythology, and fairy-story – not, however, Victorian in authorship, as a rule to which George Macdonald is the chief exception.
Having spent way too much time reading Tolkien, I can to some extent attest to this. The similarities that have been called to my mind reading his work has always been of things like King Arthur or the dwarves of Nordic myth or what have you. I can say with all honesty that even having read Macbeth I only compared Dunsinane wood to the Ents because I'd read his letters - not because they struck me as particularly similar. Prospero in the Tempest is to me a very different wizard from Gandalf.
Perhaps this is much a personal impression as anything but I feel one does the Lord of the Rings a disservice (or really, almost any literature but that by those like T.S. Eliot, who invite this sort of thing) by trying to see if such and such passage came from such and such other passage - sometimes, an author is just telling a story. (Then again, I shouldn't throw stones in a glass house, as I'm writing a paper comparing Durin and King Arthur.)
While I've presented in this answer as much evidence as I could dig up in your favor, it really doesn't seem very convincing. Yeah, the Ring is good on the outside but bad in reality, and so is man in Shakespeare's (and probably Tolkien's, seeing as he was Catholic) view, but even if the Ring is a commentary on man, that's really not a very clear pointer towards Shakespeare. Tolkien wasn't even a very big fan of Shakespeare, at minimum, and he probably even harbored an active dislike of Shakespeare. Intertextual comparison in the Lord of the Rings - especially with more "modern" (after Chaucer) works, instead of the myths from which Tolkien primarily drew upon - is an attitude Tolkien didn't really like, and not one that is very fruitful.
And then, of course, the phrasing is something that I've seen elsewhere in books and is small enough that it's very easily the sort of thing that could be unconsciously inserted, without any actual thought going to it.