The following website offers an excellent overview of the various landmarks and attractions around St Andrews.
Here are some suggestions for a quick bite to eat or coffee around town. The list is certainly not exhaustive and is based on my own preferences.
Taste. excellent coffee and pastries, but only takeaway.
CombiniCafé. Good coffee, minimal design, few seats.
Zest. Either takeout or indoors/outdoors seating.
Northpoint. I don't necessarily recommend this place since it's a pretty standard coffee shop, but it's famous as the spot of Kate and William's first date.
Shawarma house. They also have very good falafel.
Munch. A good offering of sandwiches.
CombiniCo. Korean takeout.
Thanon. Thai street food.
Jannettas Gelateria. Ice cream.