There is the old way to add custom script to SharePoint is by allowing custom script on the sites and adding the build in script editor web parts, where only users with ""Add and Customize Pages"" permission can add custom script, so in case we enable custom script we still have some control that only users with "Add and Customize Pages" permission can do so.
now if we do not want to allow custom scripts on the site and at the same time we want to add some script editor web parts to modern pages, then we can use the modern script editor web part @ https://github.com/pnp/sp-dev-fx-webparts/tree/master/samples/react-script-editor. But adding this modern script editor web part will allow contributor users (unlike the classic script editor web part) to add custom scripts to modern pages..
so my question if it is a bad practice to install the modern script editor web part App inside our modern sites? second question, is there a way to prevent adding modern script editor web parts unless the user has "Add and Customize Pages" permission, as in the classic script editor web part?