Looking at your illustration, it seems that the mains wires are the two left wires, and the lamp would connect to the two right wires. You mentioned that the dimmer is in an enclosure. I would strongly recommend ensuring that there is absolutely no way that a determined toddler could get a screwdriver, paperclip, ham sandwich, etc... into the enclosure. Also ensure that the wires are protected with some sort of strain relief, so that when the dog trips on the cord, the wires won't come out.
EDIT:
I looked at your drawing again. It seems that there are two possibilities:
First Possibility
You are seeing 4 wires because they are 2 from the cord, and 2 from the socket. This one's easy. Connect the two wires from the plug to the left two wire positions on the dimmer. Connect the other two wires to the right two wire positions on the dimmer.
Second Possibility
Your lamp socket is wired for a three-way lamp. Usually these have 3 wires, though. One would be the neutral, one would be low, and one would be medium. With power applied to both low and medium, you get high power. You would need to check this with an ohmmeter. With a 3-way bulb installed, measure resistances across all of the wires. You should come up with something like this:
Pair Measurement
1-2 360
1-3 240
1-4 0
2-3 600
2-4 360
3-4 240
Note that these numbers are approximate, and depend on the wattage of your bulb. This table is built on the assumption of a 40-60-100 Watt bulb. In this case, 1 and 4 are Neutral and Ground, and can be tied together. 2 is low power, and 3 is medium power. Using an external dimmer, these should also tie together for the hot side. Check across the neutral/ground and
the hot side. If it reads short, there's a problem!
CAUTION
If you can't figure out exactly what each wire is for, get help! Magic smoke stinks, and so do house fires. (Been there. Not cool.)
As tronixstuff mentioned before, though, mains can kill. I've been "tagged" a few times (lucky -- I'm still here to write about it) and you need to exercise the utmost caution.
First off if you are controlling a heating element you don't need a snubber.
Second, safe is a relative term. If by safe you are asking if it will explode and catch fire then build it an find out. If by safe you mean can I or anyone here tell you that you have built a safe circuit, meaning that you won't hurt someone.... well good luck getting a commitment there. 240 VAC is generally considered unsafe voltages to mess around with, so its not wise for anyone to give you the go ahead.
Here is a link that shows an application note that will help you design the circuit.
http://www.fairchildsemi.com/an/AN/AN-3003.pdf
Safety advice:
One more comment, remember that you need to handle the peak voltage when specifying a part, and handling surges and overvoltage situations that can arise from the power company. So 240 VAC is the RMS value (average), and the peak is times the sqrt of 2, or 340 volts. So make sure you use a triac that can handle 600V for a 240VAC circuit.
Best Answer
There is going to be some stress every time the temperature changes. Small fillaments might be able to change temperature significatly enough over half a line cycle so that phase-dimming might matter, although in most cases it is probably not a large effect. If you are asking about a "heater", then presumably the thermal time constant is much much longer than a power line cycle, so there would be no harm to them due to phase control dimming.
The issue with phase control dimming is the nasty power factor is presents back to the power source and interference it can radiate and conduct back onto the power line.
For example, look at this waveform (in red) of a phase-control dimmer set to 60V. Notice how rapidly it rises- indicating that the waveform contains very high-frequency harmonics which will radiate out from the power lines, potentially interfering with sensitive circuits.
Both these are real issues, and reasons why you don't see phase control dimming much anymore. Good riddance.