Another math.stackexchange question (here: $\mathbb{G}_m$-torsors and line bundles) goes over a way to construct a line bundle $L$ from a $\mathbb{G}_m$-torsor $T \to B$, by using a decomposition $\mathcal{O}_T = \bigoplus_{n \in \mathbb{Z}} P_n$. $P_1$ is naturally isomorphic (as an $\mathcal{O}_B$-module) to the line bundle $L$ whose everywhere nonzero sections form $T$, while $P_n$ is isomorphic to $L^{\otimes n}$.
I'm interested in extending this to sub-torsors of $T$. Let $G$ be a subgroup of $\mathbb{G}_m$ (with a fixed inclusion), $T \to B$ a $\mathbb{G}_m$-torsor as above, and $S \to B$ a $G$-torsor that lives inside $T$. In a fairly natural way, the decomposition $\mathcal{O}_T = \bigoplus_{n \in \mathbb{Z}} P_n$ can be viewed as turning $\mathcal{O}_T$ into a graded ring, graded by the characters of $\mathbb{G}_m$. I'd like to use a similar construction to break up $\mathcal{O}_S = \bigoplus_{\chi \colon G \to \mathbb{G}_m} P_\chi$, in order to get a line bundle $L^\chi$ for each character of $G$. The character given by the fixed inclusion should give $L$ itself back, and its $n$th power should give $L^{\otimes n}$.
My motivation for this question involves $p$-adic modular forms, and the geometric construction of them as given by Pilloni and others. In this light, I think of sections of $L^{\otimes n}$ as corresponding to functions $f \colon (x \in B, \omega \in L|_x) \mapsto f(x,\omega) \in R$ which are homogeneous of degree $n$, meaning $f(x,\lambda \omega) = \lambda^nf(x,\omega)$. I hope that I can naturally think of sections of $L^\chi$ as corresponding to functions $f \colon (x \in B, \omega \in L|_x) \mapsto f(x,\omega) \in R$ which are homogeneous with character $\chi$, meaning $f(x,\lambda \omega) = \chi(\lambda)f(x,\omega)$. Any insight into how these interact with the above is welcome as well.
EDIT: As an addition, I have a feeling this decomposition I'm looking for might come from the coaction $\mu \colon \mathcal{O}_S \to \mathcal{O}_G \otimes_{\mathcal{O}_B} \mathcal{O}_S$ (as in the linked post from the first paragraph) and a grading by characters on $\mathcal{O}_G$. It seems to work out for $(\mathbb{G}_m)^r$, but I can't prove anything for algebraic groups $G$ where I don't really know what $\mathcal{O}_G$ looks like.