You’d like to run your scripts as a non-root user, but are afraid you won’t be able to do the things you need to do.
Run your scripts under non-root user IDs, either as you or as dedicated users, and run interactively as non-root, but configure sudo to handle any tasks that require elevated privileges.
sudo may be used in a script as easily as it may be used interactively.
See the sudoers NOPASSWD option especially.