Should be possible by making the icon change based on a variable, and having a script that changes the variable. You could use Task Scheduler or something similar to trigger the script periodically (running it via dopusrt.exe).
After the script changes the variable, it should call Command.UpdateToggle() to request a toolbar refresh.
If you use Task Scheduler (or something else outside of Opus), you might want to make it only run the script/command if Opus is running, to avoid launching Opus every time the timer fires if you wanted to have it shut down sometimes. Switch dark/light modes at certain times - #2 by Leo shows one way to handle that.