You’re very lucky you didn’t have a fire. 18ga wire is only rated for 9.5A. Sounds like you might be pushing the limits of your 20A circuit as well. If you have a electrical questions, feel free to shoot me a PM. The code varies some from place to place, but I can give you the basics of safe practices from the NEC.
Where are the band-aids?---Pro Libertate!