sed solution. Maybe it too tricky and unoptimal, but it works. As an experiment :).
It do all replacements in the one sed call by executing the one, big command sequence, generated by printf and paste usage. I wanted split this command to the multiline for readability, but couldn't - it stops working then. So - the oneliner:
sed -i -r "$(paste -d'/' <(printf 's/%s\\b\n' G{1..229}) <(printf '%s/g\n' G{230..458}))" file.txt
It is converting to the following sed command:
sed -i -r "s/G1\b/G230/g
s/G2\b/G231/g
s/G3\b/G232/g
s/G4\b/G233/g
...
s/G227\b/G456/g
s/G228\b/G457/g
s/G229\b/G458/g" file.txt
Explanation
sed -i -r "$(
paste -d'/' - joins left and right parts (which are generated in 3,4 steps) by the slash - / and the result is this: s/G1\b/G230/g
<(printf 's/%s\\b\n' G{1..229}) - makes left parts of the sed substitute command. Example: s/G1\b, s/G2\b, s/G3\b, so on.
\b - Matches a word boundary; that is it matches if the character to the left is a “word” character and the character to the right is a “non-word” character, or vice-versa. Information - GNU sed, regular expression extensions.
<(printf '%s/g\n' G{230..458}) - makes right parts of the sed substitute command. Example: G230/g, G231/g, G232/g, so on.
)" file.txt - input file.
Testing
Input
var G1 = value;
G3 = G1 + G2;
G3 = G1 + G2
G3 = ${G1} + G2
var G2 = value;
var G3 = value;
G224 = G3 + G215;
G124 = G124 + G215;
G124 = G124 + G12;
var G4 = value;
var G5 = value;
var G6 = value;
var G59 = value;
var G60 = value;
var G156 = value;
var G227 = value;
var G228 = value;
var G229 = value;
Output
var G230 = value;
G232 = G230 + G231;
G232 = G230 + G231
G232 = ${G230} + G231
var G231 = value;
var G232 = value;
G453 = G232 + G444;
G353 = G353 + G444;
G353 = G353 + G241;
var G233 = value;
var G234 = value;
var G235 = value;
var G288 = value;
var G289 = value;
var G385 = value;
var G456 = value;
var G457 = value;
var G458 = value;