Is there a technique I should use to smooth this in so it doesn't look this bad? Before paint I thought it looked fine but it's obvious my drywall skills are not as good as my other ones.
It's very difficult for a beginner to mud in the vicinity of recepticals and switches. My advice is to cut well around the switches and then tape and mud the three joints. It would require removal of the door moulding but when your done you'll find it was very easy.
This gives you all the room you need to apply your mud with a full size blade, making it much easier to blend the mound in.
There is no such thing as a flat wall every joint in the house is raised a little bit. The trick is to make it so gradual that it is imperceptible.
Make sure you cut an approximately 45° bevel in all your butt joints with a sharp knife. Set your tape in the vertical joint. Let it dry. Set your tape on your horizontal joint without overlapping. Let it dry. Sand. 1st coat vertical, dry. Sand 1st coat horizontals, let dry sand. Repeat 3 coats after you set the tape.
You should try to finish each coat as if you don't have sandpaper.
I would re-patch it. I've typically done small fixes around the house using a small piece of scrap (like a 1x4 behind the opening, fit new piece in, screw new piece to 1x4 [which is screwed to drywall higher up the whole] and apply a light coat, sand, repeat until desired).
I recently watched this video, which was a totally new technique to me. Might be worth exploring, if you're more comfortable with this approach.