I have a small suggestion regarding these lines of code (and whatever else I missed):
previous_topics += "- [#{topic.title}](#{topic.url})\n"
parent_topic.add_moderator_post(system_user, I18n.t('create_linked_topic.moderator_post_raw', new_title: "[#{new_topic_title}](#{new_topic.url})"))
I’d recommend replacing [title](url) with just url, and relying on existing Discourse functionality that displays the title of the topic from the URL. If I’m not mistaken, this would have the bonus of auto-updating the topic title displayed if the topic is renamed, which I think would be a nice touch.