It sounds like you didn't clean your phone after it got wet. Even after the phone dries, the contaminants in the water are left behind, and can continue to react with the metals inside the phone. The reaction can unfortunately be sped up by heat and electron transfer caused by running the phone.
From the sounds of it, your phone is probably already permanently damaged, likely from when it fell into the water (5-10 minutes in brackish water is pretty bad). It could also have suffered permanent damage when you put the battery in, and it exhibited abnormal behavior.
If your phone is not permanently damaged, this is likely the best chance you will have of saving it:
- Take your phone apart (http://forum.androidcentral.com/lg-optimus-s/57527-all-up-them-guts-tearing-apart-your-optimus.html) *Be very careful!*
- Pick up a couple buckets of reverse osmosis purified water (should be available at any saltwater aquarium shop). Alternatively you could substitute any kind of purified water, but I recommend against using hard water.
- One by one, dunk each part of your phone in the first bucket of water, and gently swirl it around for about 5 minutes. I would make an exception for two parts:
LCD: It's hard to give a recommendation for the LCD without seeing it in person. If the screen looks clean, I would probably skip it or wipe it down with a wet cotton swab. If you noticed water marks/contaminants under the screen when you had the phone on, you're going to have to play it by ear. Ideally, this part should be taken completely apart, and each layer should be cleaned by hand. Unfortunately, I don't know of any instructions to disassemble the LCD. Also, this part is terribly delicate.
Battery: Give it a quick dunk and a swish in each bucket, then pull it out. The battery is sealed, so it just needs the surface contaminants cleaned off.
- Remove the cleaned part from the first bucket of water, and give it a dunk rinse off in the second bucket of water.
- Set the part somewhere to dry.
- Repeat steps 3 through 5 for each part of the phone.
- Let all parts sit in a warm dry environment for 7 days.
- Put your phone back together.