It's not hard to add the endings, repeats, DS etc., once the basic linear song is created.
I don't understand what you mean by "linear".
In writing music, you write sections, and then you add repeats and navigational directions, and you're done. That's how I've always done it. That's how it is on every piece of sheet music I've ever seen. What's the "basic linear" part?