Sum of spins of electrons in a wavefunction
I think the reason you're getting confused is because when we talk about "spin", we actually are referring to two separate observable values, the z-component of the spin (properly designated $\hat{S}_z$) and the square of the magnitude of the three-component spin vector (properly designated as $\hat{S}^2$). 

The commonly used values of $+\frac12$ and $-\frac12$ are shorthand for $+\frac12 \hbar$ and $-\frac12\hbar$, the only values possible to measure for $\hat{S}_z$. 

Because of quantum uncertainty requirements, we can know the values of both the z-component and the square of the magnitude of spin at the same time, but we cannot know either the x- or y-component while we know the z-component. As a result, we can only say that the spin vector lies somewhere on a the surface of a cone centered on the  z-axis that expands upwards from the origin ($+\frac12$) or downwards from the origin ($-\frac12$). 

For two uncorrelated spins (like in a triplet state), the z-components either add (2 positive) or (2 negatives) or cancel (1 positive and 1 negative), but that only means that the net z-component is 1, 0, or -1. Even if $\hat{S}_z=0$, there is still a net spin from the x- and y-components. The value of the magnitude (or technically its square) comes from $\hat{S}^2$, which is conserved as 1 for all three possibilities. That's the S value given in your notes. For the $\hat{S}_z=0$ case, that means the spin vector lies in the x-y plane as one of the possible radial vectors of a circle with radius 1 centered on the origin in that plane.

For the correlated spins (singlet state), the magnitude squared is 0, which occurs because the two spin vectors exactly oppose each other, and all three components cancel out, not just $\hat{S}_z$, though we have no measure of the x- and y- components that are cancelling. We only know the resulting magnitude is 0.