I've found a solution for it:
dim scene1, scene2, scene3 as xpScene
dim s1sd, s2sd, s3sd as xpSceneDirector
dim s1fr, s2fr, s3fr as Long
dim fr2ms as Long
dim countdown as xpBaseWidget
fr2ms = 40 'milliseconds per frame
engine.getWidgetByName("Countdown", countdown)
engine.getSceneByID(1, scene1)
engine.getSceneByID(2, scene2)
engine.getSceneByID(3, scene3)
scene1.getSceneDirectorByName("SceneDirector1", s1sd)
scene2.getSceneDirectorByName("SceneDirector1", s2sd)
scene3.getSceneDirectorByName("SceneDirector1", s3sd)
s1fr = s1sd.duration
s2fr = s2sd.duration
s3fr = s3sd.duration
fr2ms = (fr2ms * (s1fr + s2fr + s3fr))
countdown.TimerValue = fr2ms
countdown.start
But this works only if all the scene IDs exist. Is there a way to do the math even when there is no scene present and skip it?
#XPression