Fix a base field $k$. Let’s prove carefully that if $\operatorname{Spec} A$ has a $\mathbb{G}_m = \operatorname{Spec} k[x,x^{-1}]$-action, then there is an associated grading, and conversely given a grading there is an associated $\mathbb{G}_m$-action. We will also prove these associations are mutually inverse. Hopefully this clarifies where coassociativity is used. (Namely, it is only required in defining the grading.)
A $k$-algebra $A$ is called graded, if there is a vector space decomposition $$A = \bigoplus_{m \in \mathbb{Z}} A_m$$ so that $A_m \cdot A_n \subseteq A_{m + n}$ for all $n \in \mathbb{Z}$.
If $A$ is a $k$ algebra with a $\mathbb{G}_m$ action induced by $k$-algebra homomorphism $\rho: A \to A[x,x^{-1}]$ we will define the associated grading by setting $$A_m = \rho^{-1}(Ax^m).$$ To check this is a grading, we will first show that $$\sum_{m \in \mathbb{Z}} A_m = \bigoplus_{m \in \mathbb{Z}} A_m$$ and then that $\sum_{m \in \mathbb{Z}} A_m = A$ to conclude that $A$ admits this direct sum decomposition. Once this is done, we clearly have a grading because $$A_m \cdot A_n = \rho^{-1}(Ax^m) \cdot \rho^{-1}(Ax^n) \subseteq \rho^{-1}(Ax^m \cdot Ax^n) = \rho^{-1}(Ax^{n+ m}) = A_{n + m}$$ by the definition of a ring homomorphism.
To check that the sum is direct, we let $f \in A_n \cap A_m$ for some $n \neq m$. Then, $\rho(f) \in Ax^m \cap Ax^n = 0$, so $f \in \ker \rho$. However, as noted in the question, the counit axiom implies that $\rho$ is injective, so that in fact $f = 0$. Hence, the sum is direct
To check that $\sum_{m \in \mathbb{Z}}A_m = A$, we write $\rho(f) = \sum f_m x^m$ and evaluate along the counit ($x \mapsto 1$) to see that $f = \sum f_m$. To conclude, we must show that each of these $f_m$ is in $A_m$. This step is what requires coassociativity, as noted in the previous answer, which says exactly that $\rho(f_m) \otimes x_m = f_m x^m \otimes x^m$, so that in particular $\rho(f_m) = f_mx^m$. This implies that $f_m \in A_m$, as required.
Conversely, if we’re given a grading $\bigoplus_{m \in \mathbb{Z}} A_m$ of a $k$-algebra $A$ we will define $\rho: A \to A[x, x^{-1}]$ by sending elements $f_m$ of $A_m$ to $f_m x^m$ and extending linearly. That is, $f = \sum f_m \in A$, it is sent to $\rho(f) = \sum f_m x^m \in A[x, x^{-1}]$. This linear map in fact defines a ring homomorphism because of the condition that $A_m \cdot A_n \subseteq A_{m + n}$.
Since the counit of $k[x, x^{-1}]$ sends $x \mapsto 1$, it is clear from the equation to start $f = \sum f_m$, that the composition $f \mapsto \sum_m f_m x^m \mapsto \sum f_m$ is indeed the identity, which confirms the unit condition of the action.
Similarly, since the comultiplication map of $k[x, x^{-1}]$ is $x \mapsto x \otimes x$, the coassociativity condition of the action is saying that the composite map $$f \mapsto \rho(f) = \sum f_m x^m \mapsto \sum \rho(f_m) \otimes x^m$$ is the same as $$f \mapsto \rho(f) = \sum f_m x^m \mapsto \sum f_m x^m \otimes x^m.$$ This then follows from the fact that $\rho(f_m) = f_m x^m$ by the definition of this homomorphism.
Hence $\rho$ defines an algebraic group action of $\mathbb{G}_m$ on $\operatorname{Spec} A$, by the definition found here, for example.
Lastly, we check that these are mutually inverse associations. Given a grading $A = \bigoplus A_m$, we associate the action given by $\rho(f) = \sum f_m x^m$. To this action, we then associate a grading $A = \bigoplus B_m$ with $B_m = \rho^{-1}(Ax^m)$. We claim that $B_n = A_n$ for all $n$. Clearly, $A_n \subseteq B_n$. Conversely, let $f \in B_n$ and write $f = \sum f_m$ in the original grading of $A$. Then, $\rho(f) = f_n x^n$ because all the other coefficients are zero by the definition of $B_n$. As such, $f - f_n \in \ker \rho = 0$. So $f = f_n \in A_n$ as required.
Conversely, given an coaction $\rho: A \to A[x, x^{-1}]$ we associate a grading given by $A_m = \rho^{-1}(Ax^m)$. To this, we then associate the coaction $\tau: A \to A[x, x^{-1}]$ which sends $f = \sum f_m$ to $\tau(f) = \sum f_m x^m$. But now, by the definition of the grading and the counit axiom, for $f_m \in A_m$, $\rho(f_m) = f_mx^m$ for all $m$. Hence, $\rho$ and $\tau$ agree on $A_m$, which implies that they agree on all of $A$ by linearity.