Can I safely delete photo library to save room In order to start using the Photos app on my mac, which only has a 500gb HDD, I had to plug in a 1TB external, and use that to house the Photos database file. I had to do this because I had more than 500gb of photos. 

Now they are all imported to the photos application, and I have verified they are synced up to the cloud.

Is it safe at this point to delete the photo database file from my external HDD, and then reopen the Photos application and start from scratch using my Mac's HDD with "optimize storage" enabled?

I assume it would just download everything from the cloud in a storage optimized way.
Don't do anything with the external hard drive yet, except eject it and unplug it, so you have a good backup in case anything goes wrong. That said, the following steps should do what you want.

First create a new library on your Mac's hard drive by holding Option while you open Photos, then clicking Create New.

In order to use this with iCloud Photo Library (ICL), you must designate the new library as the system photo library. Go to Photos menu > Preferences > General tab and click Use as System Photo Library. Next go to the iCloud tab and turn on iCloud Photo Library, then choose the Optimize Mac Storage option.

At this point it should start downloading thumbnails and some original files ("optimized" means it caches all thumbnails locally, then uses a certain amount of the space available on your hard drive for original files).

This answer is based on the Apple support article Designate a System Photo Library which states, at the bottom, that setting a new system library and turning on ICL will merge into (not overwrite) the existing ICL that Apple has stored on their servers. It's possible it might not, and in that case, you may not be able to do what you want.