It was a glorious summer day back in 2007. I and my dear mother, in her final year of life with Alzheimer’s disease, were taking her daily “walk” around the small courtyard behind the secure assisted living facility she now called home.

“Look at that,” Mom said, the resentment in her voice loud and clear, as she pointed to the chain-link fence barely visible behind the manicured shrubbery. “I’m in prison.”

I thought about that painful moment last week as triumphant searchers escorted 77-year-old Ruth Brennan of South Portland out of the deep woods in the western Maine town of Waterford.

Missing for two days and beset with what law enforcement officials called “memory problems,” she was otherwise in fine condition. Her safe return was one of those good news stories that leaves an entire state breathing a collective sigh of relief.

Enjoy it while it lasts, folks. It’s only a matter of time before another aging Mainer, one foot in the moment and the other not so much, goes missing and another gut-wrenching search commences.

“They’re not being reckless. They’re not being irresponsible,” noted Laurie Trenholm, executive director of the Alzheimer’s Association – Maine Chapter, in an interview Friday. “They’re doing what they believe is really the right thing to be doing at that time – and it can really get them off course.”

She’s talking about the 37,000 Mainers whose lives have been turned upside-down by Alzheimer’s or dementia. And it’s only going to get worse: The number of Maine residents between ages 65 and 74 with cognitive impairment, now estimated at 12,390, is forecast to increase 77 percent by 2020.

Meaning Lt. Kevin Adam, who coordinates search-and-rescue operations for the Maine Warden Service, has his work cut out for him.

“You never know whether this is the one where we’re going to be here for one hour, or we’re going to be here for six days,” said Adam, who led last week’s successful two-day effort.

Brennan’s happy ending came after Warden Josh Bubier, who specializes in mapping, focused his attention on a remote area about a mile and a quarter from where Brennan was last seen after setting out on foot Monday morning from a camp her family rents to a store she knows well.

“He (Bubier) said, ‘I just want to get some dogs up in there and see if we get lucky,’ ” recalled Adam. “And we got lucky.”

A team from Maine Search and Rescue Dogs – Elizabeth Fossett and her German shepherd Kobuk – found Brennan in the middle of nowhere Wednesday morning. But for Bubier’s hunch, noted Adam, there’s a good chance she’d still be out there.

Overall, Maine wardens conduct an average of 465 searches a year. Of those, 24 involved a person with Alzheimer’s or dementia in 2010, 13 in 2011 and 20 in 2012.

Typically in those cases, Adam said, the person who goes missing is in the early onset of the disease – that agonizing period when family members and friends sense that something is not right, but have yet to either seek a diagnosis or make the adjustments necessary to ensure a loved one’s safety.

“The early stages are the most dangerous,” Adam said. “You see it gradually. Then one day, bang. A bad incident happens.”

The challenge, Adam and Trenholm agree, is to strike a balance between personal freedom and common-sense precaution. And, above all, to have that heart-to-heart talk every family dreads. For advice on how to approach that, call the Alzheimer’s Association’s 24/7 help line at (800) 272-3900 or go to www.alz.org/Maine.

“There are things people can do so that if things do go awry, a connection can be made,” said Trenholm.

One is the “MedicAlert & Alzheimer’s Association Safe Return” program, which centers on a bracelet or pendant worn by the impaired person. It provides basic information about his or her condition along with an 800 number for people to call if they happen upon someone who’s disoriented.

(The association offers “scholarships” for those unable to afford the enrollment cost – $55 up front and $35 per year thereafter.)

Smartphone technology can also prove invaluable. So-called “geo-fence” applications, for example, establish a perimeter beyond which an alarm will sound to alert caregivers that an impaired individual has ventured too far. A GPS signal then tracks the person until help arrives.

Then there’s Maine’s Silver Alert, established by the Legislature in 2010. Modeled after the Amber Alert system to locate missing children, it uses everything from electronic highway signs to Maine Lottery terminals to spread the word that someone with dementia, Alzheimer’s or some other cognitive impairment has gone missing

“It’s mostly for someone who’s highly mobile,” said Adam, who didn’t activate the alert in Brennan’s case because she was on foot and thus limited to a smaller radius. Typically, he said, “they got in their vehicle, they were supposed to go to the store and now they haven’t come back. When that happens, we want to cast a net over a very wide area.”

The important thing, added Trenholm, is to act quickly.

“You want to involve law enforcement when you first suspect something is wrong,” she said. Otherwise, “lo and behold, six hours have gone by – and that can make the difference between a successful search and a horribly tragic situation.”

Trenholm, like the rest of us, paid close attention last week as the statewide media chronicled the search for Brennan. She found herself impressed on the one hand that regular exercise was so much a part of Brennan’s daily routine and, on the other, not surprised that something, however innocuous, steered her in the wrong direction.

“You don’t have the ability, at a certain point in the disease, to turn yourself around and come back out,” Trenholm said. “So you forge ahead.”

The key is to find a balance between letting a loved one head out and smell the roses and, as my family finally did when my mother’s condition left her unable to navigate even the shortest of distances, locking the gate for safety’s sake.

Equally important is understanding that when it comes to Alzheimer’s and dementia, reality is in the eyes of the beholder.

Adam will never forget a search that ended tragically when a woman with dementia was found deceased in her car, which she’d driven down an old backwoods road and “right into a bog.”

Talking later to locals in the area, he learned that the road had once been the main thoroughfare to town, the one the woman traversed daily as a young girl.

“She temporarily got on the wrong road and she just couldn’t figure it out,” Adam said. “In her mind, she was on the right road.”

In other words, the right place at the wrong time?

“Literally,” he said.