This macro should do the job. It is not very elegant, but it will work for books with a maximum of 20 authors. How it works:
First a new file is created which is needed as temporary buffer and user clipboard 9 is selected.
From top of the file a loop is executed where first command searches for start of the book block. If not found anymore, the loop will be exited. The selection after finding the start of a book block is expanded to end of the book block with a second find.
This selected book block is then copied to the new empty file where from top of the file exactly 20 single replaces are done to insert the number. Not very intelligent, but effective. Add additional replaces if necessary or remove someone, if 20 is surely too much.
Then the modified block is cut from the temp buffer and pasted over the still existing selection in the source file.
Moving cursor to end of the line and then inserting a space which is immeditately deleted seems to be useless, but without it, the following Find at top of the loop will not work. Seems to be a synchronization problem of UE at least on my slow computer with UE v11.20a.
After the loop, the cursor is moved back to top of the file, remaining content of user clipboard 9 is cleared, the Windows clipboard is selected again and the temp file is closed without saving it.
The macro property Continue if a Find with Replace not found must be checked for this macro.
Add UnixReOn or PerlReOn (v12+ of UE) at the end of the macro if you do not use UltraEdit style regular expressions by default - see search configuration. Macro command UnixReOff sets the regular expression option to UltraEdit style.
Best regards from an UC/UE/UES for Windows user from Austria