I wondered how I would approach it if I were completely new to this environment. There are quite a few ways to write a background process that glues two components together. If it were random, I'd probably pick a way to do it that wasn't very supportable. I might even choose a way to do it that is broken! :-(
I put that in capital letters and boldfaced it because it is the absolutely number one best answer for any bit of code you want to write to run in the OPML Editor. It's also a good place to start exploring, because all the power of the environment has been encapsulated. You just put the code in the right place and it'll run once a minute, hour or overnight. Or in a background thread. Or as a web page. Or... etc etc.
Everything I write is a tool, so you know they aren't going to break, at least not on my watch. And if there's a bit of functionality you need that isn't there, this is the place I would like to add it. Because it will make my programming life easier too.
Update: An excellent up-to-date tutorial on Tools by Andy Sylvester.