Trouble with writing to my arduino nano with BLE

Looping in AI2 is only useful for traversing lists, not for spending time or for waiting.

Use Clock Timers for alarm clocks and metronomes and things you want to fire with time delays between them.

You can have more than one Clock with its own Timer event, or you can use deadlines(SystemTime in ms) in global variables to space things out in time.