Sorry to hear your mother has dementia. My mother had dementia and had to take a number of tablets. She wasn't always very co-operative so there was certainly various devious plans up our sleeves to get her to take her tabs, as some, ie long term steroids, were particularly important for her to have daily.
She was diabetic, but not on any meds for it, fortunately. I take Metformin 3 times a day and, apart from the first week or so, don't have the 'loose/wind/cramp' side effects, even though I don't take the Metformin during meal. Sometimes I take it at an 'ad hoc' time and, fortunately, get no after effects so not everyone has problems with this.
If the metformin does cause your mother abdominal problems, or even toileting problems, it would be worth discussing with her GP as there is a slow release one, which seemingly has less problems.
Assuming your mother doesn't have these side effects, I would say it was preferable that she takes the Metformin with meals, as Daisy suggests, but otherwise when you can get her to take them. If she is having carers in to help with her tablets or other care, then the carers will maybe need to visit her however often she is due to take these tablets during the day.
Best of luck.