Let $G$ be an algebraic group over a perfect field $k$. Then it is know that it can be written as an extension of an affine algebraic group and a proper algebraic group.
Is there a similar result for a group over a $k$-scheme of finite type $S$?
The most obviously analogous statement over general bases is false. Here are two different counterexamples:
Let $S$ be a curve over $k$ and let $E$ be a Neron model elliptic surface. Over a point of good reduction, $E$ is proper, and over a point of bad reduction, $E$ is affine. There is no way to write $E$ as an extension of a proper group scheme by an affine one - the affine scheme would have to include the whole bad fiber but only finitely many points in the good fiber, and the quotient by such a subscheme doesn't exist.
Let $U$ be an open subset of $S$, then the group scheme $\mathbb Z/2$ over $S$ is isomorphic to a disjoint union $S \cup S$. Inside $S \cup S$ is the open subscheme $S \cup U$, which is a group scheme because it is closed under multiplication. If $S = \mathbb A^2$ and $U = \mathbb A^2$ minus a point then the morphism $S \cup U \to S$ is neither proper nor affine, and there is not any quotient group that fixes the problem.