From [Quotas for Google Services - Apps Script - Google Develpers](https://developers.google.com/apps-script/guides/services/quotas#exception_messages)

> _Script invoked too many times per second for this Google user account._ This indicates that the script began executing too many
> times in a short period. It most commonly occurs for custom functions
> that are called repeatedly in a single spreadsheet. To avoid this
> error, code your custom functions so that they only need to be called
> once per range of data, as explained in the [guide to custom
> functions](https://developers.google.com/apps-script/execution_custom_functions).

From "guide to custom functions" [Custom Functions in Google Sheets - Apps Script - Google Developers](https://developers.google.com/apps-script/guides/sheets/functions)

> ###Optimization
> 
> Each time a custom function is used in a spreadsheet, Google Sheets
> makes a separate call to the Apps Script server. If your spreadsheet
> contains dozens (or hundreds, or thousands!) of custom function calls,
> this process can be quite slow.

Pay special attention to the following excerpt from the same previous referred source

> Consequently, if you plan to use a custom function multiple times on a
> large range of data, consider modifying the function so that it
> accepts a range as input in the form of a two-dimensional array, then
> returns a two-dimensional array that can overflow into the appropriate
> cells.

Again from [Quotas for Google Services - Apps Script - Google Develpers](https://developers.google.com/apps-script/guides/services/quotas#exception_messages) (just replace Calendar by route)
  

> _Service invoked too many times_: _Calendar_. This indicates that the script called the given service too many times in one day.