How could I create a function that would add a delay?

I see two ways to customize the delays:

  1. As you mentioned, use multiply the default base delay time.
  2. Setting the delay in milliseconds.

Let’s look at both in more detail.

Multiplying the default base delay time

To complete the implementation you already started, we can copy from existing implementations.
I did a quick search and found two implementations of this approach.

This one is in a mining bot for the game EVE Online: bots/BotEngineApp.elm at 6da8babc2cff0a8e7c76b92b9c6723390347ec4e · Viir/bots · GitHub

The second example is better. It also has a detailed discussion of the design and breaks the programming down into steps: Adding a delay to undock

Setting the delay in milliseconds

When your target time is less than two steps away, use this approach for more fine-grained control of the delay. To implement this in your app, you only need to apply EveOnline.AppFrameworkSeparatingMemory.setMillisecondsToNextReadingFromGameBase on the decision value that you return from your policy function:

In other words, the type of the values you use this function on is the same as for the more often used describeBranch.

Here is an example code using it in an EVE Online bot:

    (describeBranch "Click on the module."
        (EveOnline.AppFrameworkSeparatingMemory.setMillisecondsToNextReadingFromGameBase 3333
            (decideActionForCurrentStep
                (inactiveModule.uiNode |> clickOnUIElement MouseButtonLeft)
            )
        )
    )