Thanks for the replies. Rather maddeningly, none of the Shimano tech docs / exploded diagrams give the actual size. On some older groupsets, I've read that the rear limit screws were M4 and the front ones M3. I haven't removed the remaining screw yet to measure it, but it looks more like M3 than M4 to my eye. The screw head requires a 2mm Allen key.
Hopefully is a standard metric thread and not something weird.
I'll also get some "breakable" thread-lock liquid to prevent re-occurrence. TBH, I think my derailleur position may be a bit off, because I could only just avoid chain rub, even with the limit screw almost all the way out (now "completely the way out" :-) ). But it was a bit of a chore getting the derailleur position and cable tension right - most likely my lack of experience in doing this task!