If you want a literal while loop you'll need to do that in a non-UI thread, so you could use a Task node and start it running when you start video playback. It seems safe-ish to pass a reference to the video object to the task (or at least, that's how Mux works on Roku).
If you just need some bit of code to run on an interval you can use the "Timer" node.