You want to somehow damage the cavernous nerves of the penis. If you damage the preganglionic root of the cavernous nerves (the pelvic splanchnic nerve), you'll create all kinds of other problems.
You might also consider using a chemical agent instead of surgery; this will allow for increased discretion and ease of administration. I discuss this after the break in my answer.
Erection is driven by the parasympathetic nervous system; ejaculation is driven by the sympathetic nervous system. Since you're looking for "permanent and total erectile dysfunction," you want to disrupt parasympathetic innervation to the penis. The candidates you've mentioned (dorsal nerve, pudendal nerve, inferior rectal nerve, perineal nerve, posterior scrotal nerves) won't work since none of them provide parasympathetic innervation to the penis. Rather, the dorsal nerve of the penis is a branch of the pudendal nerve and provides sympathetic (ejaculation) and sensory innervation; the inferior rectal nerves are also branches of the pudendal nerve and provide purely somatic innervation to the anus (these lie below the pectinate line, which marks the boundary we use to define internal and external hemorrhoids); the posterior scrotal nerves are a sensory branch of the perineal nerve, which itself is a branch of the pudendal nerve. This plate from Gray's will help you visualize these relationships.
"The Epidemiology and Pathophysiology of Erectile Dysfunction." Melman et al. The Journal of Urology. 1999.
factors. Normal penile erection
is a hemodynamic
muscle relaxation mediated
parasympathetic neurotransmission, nitric
So, let's say you want to go after the parasympathetic nerves to the penis – the cavernous nerves. These are postganglionic, meaning they've already synapsed in the cell bodies of their target organ. Here's another plate from Gray's to make clear the parasympathetic (blue) vs. sympathetic (red) innervation in the body:
As you can see, the preganglionic pelvic splanchnic nerve might be an easier target than the postganglionic cavernous nerves, which will be running all over the tissue of the penis, making them difficult to quickly and directly target. However, you risk disrupting other hindgut functions as you move closer to the sacral spine.
"The actions of parasympathetic and sympathetic nerves in human micturition, erection and seminal emission, and their restoration in paraplegic patients by implanted electrical stimulators." Brindley. The Royal Society. 1988.
Appropriate stimulation of the S2 roots causes the erectile tissue of the penis to swell... Implants that stimulate the S2, S3, and S4 anterior roots improve micturition, defaecation, and penile erection in many patients with spinal-cord injuries.
Your desired discretion will go out the window if your antagonist wakes up unable to normally urinate or defecate, so you might target the prostatic plexus, where the branches of the cavernous nerves arise, but this is a relatively deep structure (bound within the prostatic sheath) that you won't be able to discretely injure. When scientists test cavernous nerve injuries, they use a variety of techniques, but none of them are particularly non-invasive:
"Functional Sequelae of Cavernous Nerve Injury in the Rat: Is There Model Dependency." Mullerad et al. The Journal of Sexual Medicine. 2006.
Nerve Manipulation Techniques
(1) Control group (C): underwent a laparotomy
only to control for the effect of anesthesia. The
pelvic organs were not disturbed and thus the
result was no visualization of the CN. (2) Exposure
group (E): laparotomy and dissection of the pros-
tate to enable visualization of the CNs bilaterally
without any direct CN manipulation. (3) Neurot-
omy (N): the CNs were transected bilaterally,
5 mm distal from the ganglion, with as much of
the overlying fascia preserved to allow approxima-
tion of the nerve ends. (4) Bulldog clamp crush
group (B): a vascular bulldog clamp (60 g/mm
Fine Science Tools, USA) was applied to each CN,
5 mm distal to the ganglion. It was applied for
30 seconds, removed for 30 seconds, and then
reapplied for a further 30 seconds. (5) Hemostat
crush group (H): an ultra fine hemostat (12.5 cm, nonserrated, Fine Science Tools) was applied with
full tip closure in the same manner as for the B
Understanding the anatomy of the penis will help you decide how to proceed. I think you're on the right track with a neurovascular or nerve injury. "The Physiology of Human Penile Erection" (Weiss, Annals of Internal Medicine, 1972) includes this great figure, where each labelled letter in the pathway relates to a specific site of erectile dysfunction-causing injury:
You're most focused on sites F, G, and H. Here, F is caused by long-term illness and G is caused by, once again, invasive surgery:
SITE F The incidence of erectile dysfunction in diabetes mellitus exceeds that in diabetic retinopathy or nephropathy. In a random study of 200 diabetic men, 59% were impotent. The incidence of impotence does not correlate with the duration of the diabetes, the severity of the imbalance in carbohydrate metabolism, or the degree of diabetic control. Impotence is occasionally the initial clinical manifestation of diabetes, and diabetes should be considered as a possible cause whenever a man complains of impotence. Ellenberg found a high correlation between neurogenic bladder abnormalities and impotence and thereby postulated that an autonomic neuropathy was the cause of impotence in diabetes mellitus. Other causes of autonomic neuropathies are also frequently associated with impotence. Simpson speculated that a diabetic angiopathy involving the small vessels of the erectile tissues might impede the blood flow and lead to impotence in some cases.
SITE G Radical surgical procedures, such as abdominoperineal extirpation of the rectum, frequently destroy the nerve plexuses from both spinal erection centers, resulting in complete impotence. The effects of sympathectomy on potency, if any, have been discussed earlier. Other surgical procedures, such as transurethral prostate resection, that do not interfere with the neural or vascular structures mediating erection usually do not alter penile potency.
SITE H Drugs that inhibit the action of acetylcholine on structures innervated by postganglionic autonomic nerves (for example, methantheline bromide) occasionally cause impotence. This effect is consistent with the role that cholinergic fibers play in opening the polsters and initiating erection.
Alternative method: chemical agent
Site H caught my attention most, since the author mentions inhibitory drugs causing impotence. This might be the non-invasive, discrete route you've wanted.
"Pharmacology of Penile Erection." Andersson. Pharmacological Reviews. 2001.
Phosphodiesterase Inhibitors. The L-arginine/NO/GC/cGMP pathway seems to be the most important for penile erection in some species (see above), and recent results with sildenafil, a selective inhibitor of the cGMP-specific PDE5, further support the view that this may be the case also in humans. Sildenafil is 4000 times more selective for PDE5 than for PDE3, 70 times more selective for PDE5 than PDE4, but only 10 times more selective for PDE5 than for PDE6. Sildenafil is rapidly absorbed after oral administration (bioavailability 41%) and has a plasma half-life of 3 to 5 h.
PDE5 degrades cGMP, which is required for an erection. PDE5 inhibitors (Viagra, Levitra, etc.) prevent cGMP degradation. You might have your protagonist culture PDE5-overexpressing cells and isolate the enzyme (or, she could buy a bunch from Sigma) and sneakily inject the isolate into your villain. This probably wouldn't really work, but I think it might be a better (more plausible) fictional solution than a surgery, which you won't be able to cover up without some other kind of trauma to the area. (Plus, at that point, why not just use the cover-up trauma to create the erectile injury in the first place?)