  Let $\mathfrak{g}$ be a real finite-dimensional Lie algebra equipped with a
symmetric bilinear form $\langle\cdot,\cdot\rangle$. We assume that
$\langle\cdot,\cdot\rangle $ is nil-invariant. This means that every nilpotent
operator in the smallest algebraic Lie subalgebra of endomomorphims containing
the adjoint representation of $\mathfrak{g}$ is an infinitesimal isometry for
$\langle\cdot,\cdot\rangle $. Among these Lie algebras are the isometry Lie
algebras of pseudo-Riemannian manifolds of finite volume. We prove a strong
invariance property for nil-invariant symmetric bilinear forms, which states
that the adjoint representations of the solvable radical and all simple
subalgebras of non-compact type of $\mathfrak{g} $ act by infinitesimal
isometries for $\langle\cdot,\cdot\rangle $. Moreover, we study properties of
the kernel of $\langle\cdot,\cdot\rangle $ and the totally isotropic ideals in
$\mathfrak{g} $ in relation to the index of $\langle\cdot,\cdot\rangle $. Based
on this, we derive a structure theorem and a classification for the isometry
algebras of indefinite homogeneous spaces of finite volume with metric index at
most two. Examples show that the theory becomes significantly more complicated
for index greater than two.
