How can I correctly setup attachInterrupt() in this sketch?

The principle generally applies to processors handling variables wider than a single bus transaction can handle.