Aww poor guy, welcome to the forum, sorry it's under this condition though.
Yes, filling out the above will help greatly. But right now I would place him in a smaller container/tank. If he is in a 1 gal, you can keep him in that.
For now, with the swollen eye and vertical position I would suggest using Epsom Salt which you can purchase anywhere there is a pharmacy at, such as Walmart.
I'd start out with 1 tsp of Epsom Salt per gallon (dissolve it prior to adding him in it, also dose for full volume of the tank with water conditioner), daily 100% water changes with like-temp water until you notice an improvement in him, I'd say about 10 days.
3-5 years is their average life span, so he is up there, but could still go on for a couple years possibly.
Also his lethargy and not eating may be temp related, which once you fill out the questions above, we can get an idea on if there is anything else happening with him.