Thanks a lot for sharing the script!
I too am considering switching to Obsidian at least to see the difference wrt LogSeq as per my current note-taking approach.
I like Obsidian's community and development better but used LogSeq because of the outliner experience.