To answer the original question: Certainly it's possible for $L$ to be non-reductive (and non-solvable) while a Levi subalgebra $S$ is an ideal. Just form the direct sum as Lie algebras of your favorite semisimple Lie algebra and a nonabelian solvable Lie algebra. I think the additional edited question about when $S$ can be an ideal is more interesting. Throughout the discussion it's important to work just with finite dimensional Lie algebras over a field of characteristic 0, since otherwise the classical results break down.
What's involved here is usually called the Levi-Mal'cev Theorem, given thorough treatments in older books such as Jacobson Lie Algebras (III.9) and Bourbaki
Groupes et algebres de Lie (Chapter I, Section 6.8). (The brief online treatment in the Springer math encyclopedia isn't quite correct, but there may be other online sources.)
Both parts of the theorem are relevant here: the existence in $L$ of a semisimple subalgebra $S$ complementary (in the vector space sense) to the solvable radical; the conjugacy of all such subalgebras $S$ under the subgroup of automorphisms of $L$ generated by all exp(ad x) with x in the nilradical. Bourbaki states as Corollary 4 of the theorem that every ideal in $L$ is the direct sum of its intersections with $S$ and with $rad(L)$ (the former being a Levi subalgebra in the given ideal). In particular, when $S$ itself is an ideal of $L$ it must be the unique Levi subalgebra. All of this follows easily from the Levi-Mal'cev Theorem, though the proof of the theorem itself is nontrivial. The conjugacy of Levi factors is really essential here, not just the existence.
To return to the header of the original question, it should be clear by now that $S$ is an ideal precisely when $L$ is a Lie algebra direct sum of a semisimple Lie algebra and a solvable Lie algebra.