Delaying an action inside a function
unsigned long triggerMillis = 0;

  if (digitalRead(CONTROLLINO_A8) == HIGH &amp;&amp; !skeleLatch)
  {
    skeleLatch = 1;
    wTrig.trackPlayPoly(2);
    triggerMillis = millis();
  }

  if (millis() - triggerMillis &gt;=14000 &amp;&amp; skeleLatch)
  {
    digitalWrite(CONTROLLINO_R1, LOW);
    skeleLatch = 0;
  }


This should work, depending on how long your CONTROLLINO_A8 is staying high you might want to invest some more time to set up an interrupt on that pin, to make sure you don't miss a trigger.