I appreciate your concern, and to a degree share it, since my family tree is littered with dementia. However, these sorts of correlations exist for so many drugs, behaviors, environmental factors, etc. that I'm not sure how anyone would live their lives if they tried to avoid all of them. New correlations are constantly emerging. Therefore, until they are more than statistical correlations, I tend to react more with "huh" than worrying or changing any of my choices.
I've found myself among the 80%, the 20%, and the 1% probability categories before when it has come to drugs and side effects. I do think that if you see a 20% side effect and it worries you, or if you have other reasons to believe you fall into that category, then it's perfectly reasonable to avoid the drug. If you see a 20% side effect but the drug is something that really helps you, it's about weighing the benefits against the risks and moving on.
If I had Parkinson's and the issue was Lewey Body dementia, or if I had a family history of early onset Alzheimers, or a known genetic propensity, then I would be more concerned. But even then, it would be a risk/benefit analysis, and if the gabapentin helped materially right now, I would go for it. In fact, I've taken it for years for restless legs, and would not stop due to this particular study.
It's important to realize that cause and effect for this sort of thing can go both ways, too. In other words, it may be that people who are more prone to dementia are also more likely to have issues which are effectively treated with gabapentin. Or even have genetics that cause gabapentin to be more effective for more problems, and therefore more likely to be used. Having not read the study, my guess would be that they tried to correct for this sort of thing, but it's not practical to correct for all of it, especially since it's data in these sorts of records can be hit or miss, and it's really early days for this kind of genetic data to be available in those records.
Sadly previous experience often led me to the news of a wonderful new treatment, or a development that would be starting "human trials" soo, but my spouse died before those trials bore fruit. Now my current spouse's condition has me tracing stories , but you are correct in your assertions that risk and reward have to be balanced. I guess if theres something other than gabapenten the doc'll know. Meantime we should live our best life.