Thanks for your code, I extended it and made a plugin for UE5.1+, I’ll leave it here in case anyone needs it:
StaticMeshUtilities.zip (11.4 MB)
It allows you to:
-
Copy sockets from a source static mesh to N meshes, and choose whether or not to preserve the existing ones

-
Delete all the sockets from N static meshes
-
Create multiple sockets at once with a sequential number and a progressive offset

Example of the result of the previous window:
