Hi Jen, and welcome to the board!
Sorry to hear about poor Pumpkin. I suspect it is high ammonia which is causing him to dart around the tank. I know you probably already know this, but a 2 gallon tank is far too small even for 1 goldfish. Goldies need a minimum of 10 gallons each (ideally more like 15-20 gallons each). In such a small quantity of water, toxins such as ammonia and nitrite build up very rapidly and turn the water into a burning posionous soup. Plus, Pumpkin will not be able to grow properly - he should eventually reach a length of at least 8-10 inches, but he can't in 2 gallons.
Anyway, as for your questions, yes the ammonia and nitrites are high because the tank is cycling. You need to test the levels of all three key parameters - ammonia, nitrite and nitrate - every day and change enough water to keep ammonia and nitrite between 0.5 and 1.0. (This is a safe level for Pumpkin but still allows enough 'food' for the bacteria which colonise in the filter).
These water changes might be as high as 80% or as low as 10% - it will vary day to day. When no more ammonia and nitrites show up - only nitrates - then the tank is cycled and you can relax a bit on the changes. However, in such a small tank water quality will always be an issue; you might have to do 2 or 3 changes a week even after cycling.
I wouldn't add Melafix until the water quality has been completely sorted out as it can irritate fish skins and Pumpkin sounds like he's irritated enough right now! 2 teaspoons of salt added to the tank would help reduce the effects of the high nitrites however and help prevent infection getting in where his scales are missing; it will also help with the fraying fins. Dissolve the salt first in a little tank water and then pour it in. Any salt will do, as long as it does no have anti-caking agents - check the ingredients.
As for Ammolock, I have never used this myself but it can be useful to help control the ammonia during cycling. It's Ammolock you need by the way, not Ammo Rocks - Ammolock stops the ammonia hurting the fish but still allows the bacteria to feed on it; Ammo rocks don't.
Hope this helps.