Gerbview did not handle redefinition of variable like $3 = $3 / 2 This redefinition is sometimes found in Gerber files. This is a long standing issue now fixed. Fixes #7222 https://gitlab.com/kicad/code/kicad/issues/7222
and add comments. No actual code change.
Some other code cleaning, but no actual code change.