After playing around with the code a little, it appears that the reason the search failed in my previous example is,
that the search in the block is performed before the commit in the same block,
even if the commit precedes the search.
Since the search was already performed before the commit,
therefore the search could not locate the searched tag and failed,
and because the search failed,
therefore the commit was never performed.
However, if a different block, even if it occurs later, contains a commit using the same tag,
then the commit in that block succeeds (because in that block there is no search whose failure could prevent the commit), and
consequently the search in the first block succeeds,
and then the commit in that same first block as the search, now also succeeds,
and then the search succeeds a second time, this time with respect to the value committed in its own block.
Is that a bug, or is it really the way it's supposed to work?