A diagonalizable group scheme $G$ over a ring $k$ is a group scheme satisfying the following equivalent conditions:
$G$ is the Cartier dual of a constant group scheme.
$O(G)=hom(G,O_k)$ is a character group i.e. $O(G)$ is generated by morphisms $G\to \mu_k$ into the multiplicative group scheme.
Let $H$ be a constant group scheme. Let $G=D(H)$ be its Cartier dual. By definition we have $D(H)(R)=hom_{Grp}(H\otimes_k R, \mu_R)\simeq hom_{Grp}(H,R^\times)\simeq hom_Alg(k[H],R)$ and hence $G=Spec\,k[H]$. Here $k[H]$ is the group algebra of $H$ and the last isomorphism is given by the adjunction called the universal property of group rings and each $\zeta\in H\subset k[H]$ is a character of $G$. Note that -as is any group algebra- $k[H]$ is a Hopf algebra.
Conversely, if $G$ is affine and $O(G)$ generated by characters, let H be the group of all characters of G; then the canonical map $k[H]\to O(G)$ is surjective. But it is always injective (by Dedekind's lemma on linear independence of characters?), hence $k[H] \simeq O(G)$.