The chemical reactions and pathways involving diterpenoid compounds, terpenoids with four isoprene units.