A few weeks ago we had a new roof put on, and when they were done we had an electrical issue that appeared to be caused by a wire having a nail hit it, and it caused a portion of a circuit to quit working: 3 plugs and an outside flood light on our porch. On the rest of that circuit everything still worked. Turns out it was a nail from the roof causing that problem.
We finally found out the cause of the original issue that we couldn't track down. Turns out a plug was taking it's time shorting out and the neutral wire in the wall connected to the plug finally burned all the way through and separated causing those plugs and flood light to quit working. The electrician said we still had power going to those plugs and light, but the burned wire was the cause of not only the plugs and light not working, but also was probably the source of that off and on electrical smell. He said it had burned up inside the wall a few inches, but he could still fix it, and then explained how he'd do that.
So, now it's all fixed. He also put in a dedicated plug on its own circuit so we could plug in a small oil heater we use in that room. He thought that heater could have pulled too much power from the shorted out plug, and since it was on a circuit being used by various other household items, at times (not all the time), put a strain on that particular plug. So, now we have a dedicated circuit for the heater.
Thought I'd post this info, since we finally found a solution as to what was causing that electrical smell in the air off and on.