The drawing of lines as you have explained, gives a group law only in the case of genus $1$ curves. This does not work for any other genus.
The reason is that the Riemann-Roch theorem gives the third point, under the composition, and it works out only in the case of genus $1$. Riemann-Roch is the most important theorem in the study of Riemann surfaces, or algebraic curves. When you set up the situation in terms of divisors and apply Riemann-Roch, you kind of get associativity "for free". This seems the most natural explanation to me. This is also much the same as the Jacobian explanation given earlier.
This is given in Silverman's AEC. But it is a bit algebraic.
See the proof of the group law in J. W. S. Cassels, Lectures on Elliptic Curves. First the proof given by Harrison Brown is explained, and then this "conceptual" explanation using Riemann-Roch is given.
However since your approach is complex analytic, it will be very instructive to look into Rick Miranda's book on Riemann surfaces. Also Raghavan Narasimhan's ETH lecture notes give the complex analytic construction of the Jacobian variety, referred to by other people in earlier answers.
The more advanced(and definitive) volume on complex algebraic geometry is of Griffiths and Harris.