Note: This is an answer to an earlier version of the question about whether there is an $O(\log n)$ bound on the length of an arbitrary subgroup chain of a group in case (b). The example below shows that the answer to that question is no, and we cannot do better than $O((\log n)^2)$.
${\rm GL}(n,p)$ acts primitively (in fact $2$-transitively) on $(p^n-1)/(p-1)$ points, and it has (for $n$ even) an elementary abelian $p$-subgroup of order $p^{n^2/4}$ (think of upper unitriangular matrices with an $n/2 \times n/2$ block in the top right corner), and hence a subgroup chain of length $n^2/4$.