One advantage of dxtoolkit is that you can pipe the output to other UNIX commands. Try the following:
dx_get_db_env | grep VDB_NAME
echo $?
The grep command returns a "0" if it find a match for a regular expression (in this case, the VDB_NAME you are looking for. You query the return code of the last command in UNIX with the special string "$?".
If $? equals 0, you have the VDB_NAME already. If it's 1, you don't.