I went and said something I shouldn't have said.

Literal

Not-say-preferably-[classical-ずもがな] [attributive-の] thing [object-を] said-[unfortunately-てしまった].

~ずもがな is a rare classical-origin set phrase literally 'preferably not X-ing' — used attributively as 'something better left unsaid' or 'the unnecessary/regrettable X.' It preserves the classical negative ~ず + もがな (the classical particle of wishing) = 'would that not.' Often in the fixed form 言わずもがな. ~てしまう adds regret.