Combine "insert_between" and "concat" into a single function with an optional separator.