You're almost there! The problem is that, as you've surmised, the group $\mathrm{Aut}(x)$ does not capture enough of the geometric structure of $G$. But that's easily solved:

For every $x\in X$ we can define a *sheaf* of groups $\underline{\mathrm{Aut}}(x)$ such that for every $k$-scheme $S$
$$\underline{\mathrm{Aut}}(x)(S):=\mathrm{Aut}_{X(S)}(x_S)\,.$$
where $x_S$ is the image of $x$ under the functor $X(k)→X(S)$ induced by the map of schemes $S\to \mathrm{Spec}\,k$. That this is a sheaf follows from the definition of stack ("descent for morphisms"), the details might depend on your preferred way of phrasing the definition.

Then, for every sheaf of groups $G$ we can define a stack $BG$, such that for every $k$-scheme $S$ $BG(S)$ is the groupoid of $G_S$-torsors over $S$ (this recovers the notion when $G$ is a group scheme). Note that $BG(k)$ has a distinguished object $\ast$ (corresponding to the trivial $G$-torsor over $k$) such that there's a canonical isomorphism of sheaves of groups
$$\underline{\mathrm{Aut}}(\ast)\cong G\,.$$

Then the groupoid of maps $BG\to X$ is the groupoid of pairs $(x\in X(k),\varphi:G\to \underline{\mathrm{Aut}}(x))$, where $x$ is an object of $X(k)$ and $\varphi$ is a map of sheaves of groups. The morphisms in the groupoid are the morphisms in $X(k)$ that conjugate the maps from $G$.

The map in one direction is easy: it sends $F:BG\to X$ to the pair $(F(\ast),G\cong \underline{\mathrm{Aut}}(\ast)\to \underline{\mathrm{Aut}}(F(\ast)))$.

The map in the other direction is slightly trickier: suppose I have a pair $(x,\varphi)$. Then for every $S$ I have to give a functor $BG(S)\to X(S)$. Essentially this sends a $G_S$-torsor $T$ to $T\times_{G_S} x_S$, where $G_S$ acts on $x_S$ via $\varphi$. Making this precise is a bit annoying and hence I shall leave it as an exercise.

Really, the easy way of conceptualizing this (and arguably proving it) is to notice that $BG$ is the stackification of the prestack $BG^{pre}$ sending $S$ to the groupoid with one objects and $G(S)$ automorphisms. Then we can compute the groupoid of maps $BG\to X$ as the groupoid of maps $BG^{pre}\to X$, and the latter is easily seen to coincide with my description above.

For the homotopy theorists that might be listening: yes the above could be simply summarized by saying that the functor from groups to pointed groupoids sending $G$ to $BG$ is the left adjoint to the functor sending $X$ to $\Omega X$.

All I described here works in an arbitrary topos: I did not use that the sheaf of groups $G$ came from a group scheme.