Please do not edit the inittab, unless you know exactly what you're doing. The inittab controls the run level which the OS boots into; and an errorneous inittab can result in you having to reinstall and/or rescue the OS.
If you want to persist your JAVA_HOME environment variable; every time you login; this is done in the following way:
1. Login as the user that you want the JAVA_HOME to be set for - remember every user has a set of environment variables.
2. Edit the /home/myuser/.bash_profile:
$ vim /home/myuser/.bash_profile
3. Add the following in:
4. Save and logout.
Thereafter; whenever you login as that particular user; your JAVA_HOME will be set.
In terms of having a script run every time you reboot; give me a bit more information on the script and the distro you're using and I can advise.