Please check http://www.juniper.net/techpubs/software/screenos/screenos6.3.0/630_upgrade.pdf page 8 & 9 (upgrade path) . If device is at 5.4.r16 then you don't need any intermediate upgrade, you can directly upgrade to 6.3.x . Just take care of the boot loader and the software signing key.
6.3.0r22 is the latest version and please refer below document for skey details and to avoid bogus image error etc:
http://kb.juniper.net/InfoCenter/index?page=content&id=KB25626&smlogin=true&actp=search
http://kb.juniper.net/InfoCenter/index?page=content&id=TSB16495&smlogin=true&actp=search
Thanks,
Vikas