First, check with your insurance, as many policies cover repairs to appliances damaged by electrical storms. It can't hurt to ask.
Am I to understand, though, that you are attempting to get sound in to your G5 using the optical data out port? If so, you won't have much luck. If you need to get sound in and your line-in is broken, you could use an iMic adapter to let you plug sound sources in through the USB port.