I am unable to understand the reason and motivation of the author that why did he set $$ f ( x ) = \sum r _ \alpha s ( h _ \alpha ) \text . $$
The importance of Hamel bases for description of additive functions is manifested by the following
Theorem. Let $ H $ be a Hamel basis and let $ s : H \to \mathbb R $ be an arbitrary function. Then there exists a unique additive function $ f : \mathbb R \to \mathbb R $ such that $ f ( h ) = s ( h ) $ for any $ h \in H $.
Proof. Set $ H = \{ h _ \alpha \} $. Given a function $ s : H \to \mathbb R $ we can define a function $ f : \mathbb R \to \mathbb R $ in the following way. Let $ x $ be an arbitrary real number. Then $ x = \sum r _ \alpha h _ \alpha $, where $ r _ \alpha \in \mathbb Q $ and only finite of the numbers $ r _ \alpha $ are nonzero. $ \require {color} \color {red} \text {Set } f ( x ) = \sum r _ \alpha s ( h _ \alpha ) \text . $ Then it is clear that $ f ( h _ \alpha ) = s ( h _ \alpha ) $ for any $ h _ \alpha \in H $ and we have to prove that $ f $ is an additive function. Let $ x = \sum r ' _ \alpha h _ \alpha $ and $ y = \sum r '' _ \alpha h _ \alpha $, where $ r ' _ \alpha , r '' _ \alpha \in \mathbb Q $. Then it follows that $$ \begin {align*} f ( x + y ) & = f \left( \sum ( r ' _ \alpha + r '' _ \alpha ) h _ \alpha \right) \\ & = \sum ( r ' _ \alpha + r '' _ \alpha ) s ( h _ \alpha ) \\ & = \sum r ' _ \alpha s ( h _ \alpha ) + \sum r '' _ \alpha s ( h _ \alpha ) \\ & = f ( x ) + f ( y ) \end{align*} $$ and the theorem is proved.
Note that the $r_\alpha$ in this definition depend on $x$.
The definition is such that $$ f\left(\sum_{h_\alpha\in H} r_\alpha h_\alpha\right) = \sum_{h_\alpha\in H} r_\alpha\, s(h_\alpha) $$ for all choices of the $r_\alpha$ (with only finitely many coefficients non-zero).
In particular, for any $h_{\alpha_0}\in H$ we can express $h_{\alpha_0}=1\cdot h_{\alpha_0}$ as such a linear combination by letting $$ r_\alpha = \begin{cases} 1 & \text{if $\alpha=\alpha_0$,} \\ 0 & \text{otherwise,} \end{cases} $$ This leads to $$ h_{\alpha_0} = \sum_{h_\alpha\in H} r_\alpha h_\alpha $$ so that $$ f(h_{\alpha_0}) = f\left(\sum_{h_\alpha\in H} r_\alpha h_\alpha\right) = \sum_{h_\alpha\in H} r_\alpha\, s(h_\alpha) = s(h_{\alpha_0}), $$ which accomplishes that $f$ and $s$ agree on $H$, as desired.