scripting: use String.length()==0 instead of String.equals(empty string)

Change-Id: Icff6a5d19aaf7ac7ebb0cd54140bd388cba0f24d
Reviewed-on: https://gerrit.libreoffice.org/11431
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>