I read this story sometime between 1989 and 1991 in a SF&F magazine (Asimov's Science Fiction? The Magazine of Fantasy and Science Fiction? Amazing Stories?)
"Behind the Barrier", a short story by Stephen Kraus. As far as the ISFDB knows it was never reprinted, but appears only on pp. 141-159 of The Magazine of Fantasy & Science Fiction, December 1990, which is available at the Internet Archive.
It takes place in the future. A neurosurgeon uses MRI scans to map out a person's neural map. Upon finding cancer or clots, he programs nanobots to enter the body and clean up the disease.
It glided again down the alley, to the dark far end. Another cell. The receptor probed, feeling . . . there, the self-protein again, twisting around and . . .YES!! The antigen molecule!
The receptor fired: a blinding rush of pure white hate. A web of protein fibers extended, drew the target closer. Gross, misshapen cellular morphology—a cancer cell, thrashing in the T cell's fatal embrace. Enzymes streamed out.
Conrad leaned forward in his chair, his hand clenched inside the glove. "Die," he whispered. "Die."
The cancer cell heaved, then turned inside out, protoplasm spattering. Conrad exhaled, wiping sweat from his face. He pulled his hand out of the glove. The simulator display froze. The T cell was smeared with slime, triumphant, its receptor thrust brutally forward.
Greta was going to live.
Conrad blinked off the monitor, took a deep breath. The rest was routine—just some molecular assembler programming.
His ex-wife, whom he still loves, comes for treatment.
Ex-lover, not ex-wife:
"Your mother died of leukemia," he said, astonished.
They'd been lovers—however briefly—and she had never told him.
When she leaves, he experiments with showing his photograph to the simulated retina and finds where it lights up in the simulation. Seeing a blocked neuron, he programs the nanobots to destroy her cancer and to re-establish contact to this cluster by reconnecting the block.
She stared at him with huge, accusing eyes.
He looked down. "I sent a machine into your central nervous system. One machine the size of a virus. That's all.
She moved to a safe distance. "Go on."
"That's all, really. Your cancer was so simple. I had hours left over before you came back. So I showed your simulation a picture of me. It was just an experiment. I followed the impulses. I found the recognition center right away—I'd made a strong impression on you, whether you realized it or not. There was a path that led away from it straight into your thalamus: affection, pleasure—something strong. But there was a clump of inhibitor neurons wrapped around the center, firing full-time."
She looked ill. But she was listening.
"That was abnormal," he said. "Don't you see? It was pathological. Those inhibitors prevented you from feeling anything, prevented you from responding. They've been there for years—maybe since your mother died—I don't know. The repair was so easy. My machine bound up the transmitter they were secreting, turned off the inhibition. One machine, that's all."
After her surgery, she falls back in love with him, but after a while, discovers the manipulation and leaves him.
Here's Conrad talking to Greta about his day at work:
Conrad stopped. He was talking too fast. And saying far too much.
Greta's face changed, the intrigued look turning inward. "You can change someone's brain?"
"Well, of course I can," he said, flustered. "I can change anything. I have all the data. All I have to do is edit it."
Her eyes were enormous and vacant. "You can change someone's brain?"
The warm flush that had started on her face when she first saw him drained to a chalky white.
"Greta, are you all right?"
She stood up, suddenly as unsteady as on the day she had first walked into his office. "Is that what happened to me?"
This exchange leads to Conrad's confession in the previous quotation. She leaves him.
To forget about her, he scans his own neurons, finds her cluster, and programs nanobots to clip the connections,
He spent hours tracing the tangled paths. Greta had seeped into every dendrite and synapse. He began to understand the visceral reaction she evoked in him—his response to her reached deep into his hindbrain and his motor neurons.
The moon rose over the city, arced across the sky, and evaporated in the sunrise. He kept tracing, cataloging, following signals as they dipped into the neural background. The paths grew ephemeral in places; he worked by instinct, taking chances.
By noon he had an approximate map of his response. From within, it was intimidating -- an impenetrable knot of connections. A kelp forest. But when he stepped back, a pattern began to emerge, and with it a strategy for programming his machines.
He was going to forget that Greta ever existed.
with the unfortunate consequence of also cutting off the neural pathways to breathing, heart regulation, etc.
Yep. The last line:
Then he forgot how to breathe.