If a family has an inherited condition, then obviously the mating of two partners carrying the same gene will make it more likely that the child is born with the condition. This does not mean that all related couples run the same risk. Some families have no inherited conditions. Other families have them, but not all members are carriers. On the other hand, the same risk will occur if you happen to marry someone outside of your family who also happens to carry the gene for whatever the condition. So it's probabilities rather than certainties. And of course cousins may not necessarily inherit the same genes, as they are only related on one side. If dd has inherited her genetic condition from my side, then any marriage to a potential cousin on father's side wouldn't make her more likely to pass it on to her child.
But obviously if a family keeps intermarrying for generations, then any genetic traits are going to be much more likely to be carried through.
Bloss, older marriage laws were not always based on much of an understanding of genetics. In medieval Europe, it was illegal to marry someone who was a godmother to the same child to whom you were a godfather, as this was considered to make you related. But I doubt that it would have much of an effect on birth defects. Besides, powerful families could always get a dispensation anyway.