If $JAVA in /etc/sysconfig/repose is set to a directory, the service script should recognize that, print a useful error message, and exit.
The simplest solution would be to add a check for [ -x file ] just to verify that the file pointed to by $JAVA is executable. There may be a better solution, though.
Also, if a command fails (such as the Java version check) the script will continue as though nothing happened. So when $JAVA points at a directory, a command in the script fails, but start function still runs which means we still get the output from that function and from the daemonize command. In other words, Repose appears to start even when a command fails. In other scripts, I handle this by making all commands conditional (using &&) but there may be a better solution.