Yes, but if you're prone to diarrhea anyways, be it from not having a gall bladder or having IBS, your antacid may make it worse. It doesn't take much to set us poopers off! Something for people with that problem to check into since I know a number of people here are on antacids of various sorts.
I don't imagine for someone with chronic constipation that a little magnesium in another drug would help. But can you get magnesium supplements on their own? If magnesium works as a bit of a laxative, it might be something you could try taking to see if it helps any. Just be careful not to take more than the package indicates and if you're on prescriptions, check to make sure you can take magnesium with them and, if they do help, ask your doctor how long it's safe to take it.