Hello,
if in doubt, one can always call c4d.StopAllThreads() before editing the active document from some user interaction in the main thread. This call will terminate other threads that may also currently use the active document (e.g. viewport rendering).
best wishes,
Sebastian