Along with dvd_drive_status, I wrote my own little standalone C program that ejects a DVD drive.
It's very simple, and is not in the least designed to be a replacement for other eject programs. What it does do is it solves the problems that I run into: waiting for a drive to be in a “ready” state after opening / closing the tray, and working with fussy DVD drives that need to be told to open more than once before it actually does it.
So, here you go, a link to the source code on github: dvd_eject.c
It's a standalone program, so compiling with gcc or clang is simple as can be:
gcc -o dvd_eject -ldvdcss dvd_eject.c