There is a <<timed>> macro and a <<replace>> macro in sugarcube. There's also a sugarcube port of that very macro set available on its website in the downloads section: http://www.motoslave.net/sugarcube/2/
Anyway, here's how a timed replace might look. This is using only the basic features of SugarCube, not the macro set from downloads
@@#replace-me; Hello! @@
<<replace '#replace-me'>> Goodbye! <</replace>>
You can read about these macros in the documentation on SugarCube's website.