They didn't try and explain that away, though. It's medicine from the future, it IS magic. If McCoy stopped to explain how it worked, and it violated KNOWN principles about how things work, you'd have a nit worth picking.
I understand everything you're saying Scout101
and I could provide numerous examples of where Trek-nobabble expalins away even theoritical science today with nonsense.
The larger point is - as a viewer of sci-fi fantasy when are people willing to suspend their disbelief and not when it comes to plot devices to make the story work.
By making the 'magic,' nanites at least IMO makes the whole electricity out thing some what plausible and within the realm of modern science. Yes there are some discontunities within the nanite supposition [e.g. lightening] but no more than IMO the multiple discontunities within Trek itself and its faux science.
How many times in Trek did we see the magical engineering solution of the week solve a major plot problem only forgotten about 3 episodes later which could have solved a similar problem? Where are the howls from the Trek fan base for some sense of conssitency within the Trek universe itself?
In any case, the nanites don't present a problem for me - nor that they can cure people from severe illness. It's already within the realm of theorticial science today that tiny robots will one day be performing micro surgery. It only takes a little larger leap of disbelief to believe they can also block electricial current.