How to add separators (vertical lines) in the dock? Is this even possible? Could be very handy for me. 

Here is an example:
I have some folders right next to the trash bin. Sometimes I accidentally put a file in the trash bin instead of in the folder.
You can put a spacer in the dock that separated documents from the trash. This is not the same as the vertical line, but may help you. From the terminal type or paste: 

defaults write com.apple.dock persistent-others -array-add '{tile-data={}; tile-type="spacer-tile";}'


after that run

killall Dock


The Dock will disappear briefly but reappear with new setting. This spacer is like an icon and can be moved along the Dock by clicking and moving the spacer to where you want it. The source I included has methods for customized spacers. It may show you how to add a vertical line.

Removing them is similar to removing any other icon from the dock. Click, hold and drag it out.

Source https://www.lifewire.com/add-custom-and-standard-doc-spacers-to-mac-2260861