We recommend booking early since St Andrews gets quite busy in the spring. Reasonably priced options include Greyfriars Inn, Albany, or The Space.
If there are no reasonable options in St Andrews, the Four Point Flex in Dundee would be a good option.
The following website offers an 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. Good coffee and pastries, but only takeaway.
The space. Nice atmosphere.
Zest. Either takeout or indoors/outdoors seating.
Northpoint. A pretty standard coffee shop, but famous as the spot where Kate and William had their first date.
The Saint. General Scottish food, nice atmosphere.
Cottage Kitchen. General Scottish food, nice atmosphere, more casual than The Saint.
Jarvi's. Café bistro with a charming outdoor seating area.
For slightly more upscale options, consider The Adamson or Rogue.
Shawarma house. They also have very good falafel.
Munch. A good offering of sandwiches.
Thanon. Thai street food.
Jannettas Gelateria. Ice cream.