How long does tortilla dough keep for? I am making tortillas with masa harina corn flour according to this recipe.

Can I make it a few hours in advance and cook the tortillas just before they are to be eaten?

Or should I cook them after making the dough and then reheat them just before they are to be eaten?
It's absolutely fine to make the dough in advance, just don't let it dry out. It even freezes well. There is more good information on Serious Eats on the subject.

Keep it on the counter for up to a day, refrigerated for up to three days, frozen for up to 6 months (for best quality). In any case that you want to hold the dough, be sure that your baking powder (if using) is of the "double acting" variety.