Harddrives can fail at any time. It appears that your harddrive's time was up. The safari update my have written to a bad portion of the drive. The changing of the application's directory may have failed creating a mess.
There are a lot of steps to replacing the hd.
http://faqintosh.com/risorse/en/guides/hw/ibook/g4hd/
Verify that this machine has a firewire port. The easiest thing would be an external firewire drive.
You need an external Firewire drive to boot a PowerPC Mac computer [ a few G5's will boot from USB ].
I recommend you do a google search on any external harddrive you are looking at.
I bought a low cost external drive enclosure. When I started having trouble with it, I did a google search and found a lot of complaints about the drive enclosure. I ended up buying a new drive enclosure. On my second go around, I decided to buy a drive enclosure with a good history of working with Macs. The chip set seems to be the key ingredient. The Oxford line of chips seems to be good. I got the Oxford 911.
I'd give OWC a call. 1-815-338-8685.
FireWire 800 + USB 3, + eSATA
&
save a little money interface:
FireWire 400 + USB 2.0
This web page lists both external harddrive types. You may need to scroll to the right to see both.
http://eshop.macsales.com/shop/firewire/1394/USB/EliteAL/eSATA_FW800_FW400_USB
(2) FireWire 800/400 Ports (Up to 100MB/s / 50MB/s)
(1) USB 3.0 Port (Up to 500MB/s / 60MB/s)
(1) eSATA Port (Up to 300MB/s)
Has a combo firewire 800/400 port. Not sure what this is. Looks like you will need 400 cable.
http://eshop.macsales.com/shop/ministack
Restore Tiger 10.4 & Leopard 10.5 DVDs are available from Apple by calling 800-767-2775 as of January 20, 2013.
https://discussions.apple.com/thread/4720126?tstart=0
Requirements for Mac OS X v10.5
http://support.apple.com/kb/HT3759
Robert