I went for modern history as I tend to prefer it! But the joys of St Andrews is that all courses are incredibly flexible, if you get there and you want to take some ‘older’ history then I think you’ll be able to? Try reading your personal statement and decide whether it leans towards a broader sense of history or modern history if you get me. You don’t need to mention modern history as they’re aware that not many unis do specific modern history courses!
Defo look into the modules and see which you prefer. I did struggle between choosing modern history or modern + Middle Eastern studies but the flexibility of courses at St A really helped me.
Apologies if that was just a mess of a ramble but I wish you loads of luck!