It looks like several files and directories in /usr/local are now owned by root, since you ran a couple of steps using sudo. To get rid of these, take back ownership of all of the files and directories under /usr/local:
sudo chown -R $(whoami) $(brew --prefix)/*
Once that is done, run brew doctor again.
Similar questions can be found here:
- https://apple.stackexchange.com/questions/192227/make-files-in-usr-local-writable-for-homebrew
- Brew doctor says: “Warning: /usr/local/include isn’t writable.”