5 gal = ~20,000 gram of water
0.25 ppm = one over 4 million
so 20,000 / 4,000,000 = 0.005 gram of nitrite are present in your aquarium.
For the sake of our rough estimation, nitrite NO2 and table salt NaCl molecular masses are not significantly different, so we will just continue working with weights in grams and not bother with the moles.
One must have table salt aka sodium chloride at 100x excess to detox the nitrite, so:
0.005 x 100 = 0.5 gram must be added to detox 0.25 ppm nitrite in a 5 gal tank
0.5 x 2 for safety = 1 gram
Thus, your latest calculation is correct. Only 1 gram.
***Sorry, when I said the rest of your math is right, I meant if you used the right number for 0.25 ppm, you would have gotten the right answer. Since you made an error early on, the answer came out wrong, although the rest of the calculation contained no arithmetic errors. Is this clearer?