Is it a good idea to 'upgrade' to a junction box? Are junction boxes more fire-retardant than Tupperwares?
Plastics are thermoset (won't melt) or thermoplastic (melt when they get hot enough). Plastic mains enclosures use
thermoset plastic or they use metal. If you use a metal enclosure it must be connected to the ground wire of your home. Mains electrical connections must be crimped or screwed, not soldered (because solder can melt). Mains enclosures should not be able to be opened without tools (because kids and humans). The live wire of a mains device should be fused where it enters the device (to prevent a fire). There are many many other rules that must be followed for the sake of safety, and this is why many jurisdictions require an electrical inspection for significant modifications to home wiring and why responsible manufacturers submit their mains-powered devices to UL or similar testing companies.
If you feel uncomfortable at all working with mains, you should pay an electrician. If a device that you built and connected to mains starts a fire that burns down your house, the insurance company could use that as an excuse to not reimburse you for the loss of the insured property. If a child touches a live mains wire in a device you created and is injured or dies as a result you could face severe criminal and civil penalties. This is not the place to play and learn and save money because the results of a small mistake due to ignorance or oversight can be tragic for you and your loved ones.
EDIT:
Re-read and realized I sound like a jerk. I'm just trying to say "Yes, and please take this stuff very seriously."
EDIT EDIT:
...and I got the thermoset thing wrong.