Then you must open the Java DMG, then double click on the Java installer, follow the prompts and complete the installation of Java 6.
But I just tried and put in a sleep, then quit System Preferences into the script and it seems to kill the System Prefs while leaving open the Java Pane.
If you are comfortable having the Java updates come down automatically, you can just tweak your next deployment package to have the auto check/install Java option enabled by default.
Using the same logic, you could likely craft a smaller package that toggles auto-updates on/off as needed for machines, keeping it deactivated on production machines, testing new updates as released, then re-enabling auto-update to allow clients to do the work of pulling down the update on their own.
Once the installation process has successfully completed, you will see the following confirmation screen.
In order to run SPSS with Yosemite or El Capitan, customers may need to have a specific version of Java runtime (Java 6).