Cinema 4D will try to open any file you drag and drop on its windows. It will call the function Identify of every plugin register with RegisterSceneLoaderPlugin. This function needs to return True if your plugin can open it. If true is return, Cinema 4D will call the function Load of the same plugin. You, of course, need to override both functions.
The Load function can be called within a thread, so get extra precautions to not call function that will trigger uncontrolled updates of the document.
Unfortunately, we don't have any example in our github repository for python, but we have one for c++
Be aware that the first plugin returning true in its Identify function will open the file, but no other scene loader will be called. The first one wins, short circuiting the others. Maybe using .txt files is not the best idea.