The toggle is your fan override, a function today's thermostats have built-in
Originally, gas furnaces didn't have fans, as they relied on convection and gravity to circulate heat through massive ducts, and as a result only required a two-wire control scheme: "should I heat the house or not?" When air-circulating central fans were added to the picture in order to tame duct sizes, in order to maintain backwards compatibility with two-wire thermostats, gas furnaces controlled the blower themselves using a thermal switch in the plenum (a "fan limit" control). Newer furnaces still needed to provide a way for the thermostat to turn the blower on themselves without calling for heat, and provided a G (green) terminal for that purpose.
What happened is the last furnace installer put in a newer furnace, but didn't change out the old thermostat or wiring. Yet, they still wanted you to be able to to turn the furnace fan on to circulate air through your house, so they put a toggle switch on the side of your furnace, connected between R and G, so you could manually do that.
However, since you're finally putting a new thermostat in, and running new thermostat cable, you can get rid of this switch, as your new thermostat will provide a way to turn the fan on manually that you can use instead. By the way, when you're buying thermostat cable, buy the fattest thermostat cable you can; having spare wires in the wall is a huge boon for when the next HVAC upgrade happens to your house.