Controlling current of 240V AC
A series resistor is a bad idea since it will dissipate significant power.  The heater in the glue gun will run cooler as you intended, but the resistor dropping the voltage will get hot.  The total will still be cooler than just the heater before, but this is not only wasteful of power, it will make the glue gun too hot to hold.

Dimmers work by by turning the power on and off rapidly.  They achieve different dimming levels by modulating the average ratio of on to off.  These things are more efficient since a ideal switch doesn't dissipate any power.  There is no current thru it when off, and not voltage across it when on.

Put the dimmer somewhere in the cord between the plug and the glue gun.  Personally I wouldn't want a glue gun with a klunky dimmer duct taped to it.  The response of the heater in the glue gun is on the order of a minute or more, so you wouldn't be adjusting the dimmer every few seconds anyway.

Another option is a variac, but at several times the cost of a glue gun, that's silly unless you have one lying around.

The obvious best option is to buy a better glue gun that has temperature control, or at least power control, built in.  You are making this way too complicated.