Spin-Hamiltonian theory of orbital near-degenerate state in tetragonal field