I've done a bit more cleanup on the last version of the patch (renamed the fields to start with bis_ as agreed, rephrased the comments / docs / commit message a bit) and pushed.
It seems that we have an oversight in this commit. If there is no tuple that has been inserted, we wouldn't have an available insert state in the clean up phase. So the Assert in brininsertcleanup() is not always right. For example:
regression=# update brin_summarize set value = brin_summarize.value; server closed the connection unexpectedly
So I wonder if we should check 'bistate' and do the clean up only if there is an available one, something like below.