You can define a trace on any vector space $V$ where there is a representation of $V$ on some other space $W$ just by picking a basis on $W$, defining the trace on $V$ as matrix trace (every element of $V$ becomes a matrix with respect to the basis of $W$) and proving that under a change of bases, the trace stays the same.
Now what to do in the case of $V$-valued differential forms? First, let us assume that there is a representation of $V$ on some vector space. Without the assumption there is no meaning of a trace, I believe. And at least for finite dimensional Lie algebras, there always is a representation, the adjoint representation.
So we have a linear map $\operatorname{tr}: V \to \mathbb{R}$.
Recall that a $V$-valued differential form on $M$ is a smooth map $\omega : TM \to V$ such that $\omega$ restricted to any tangent space $T_p M$ is an element of the $V$-valued exterior algebra $\Lambda^n (T_p M, V)$ of $T_p M$.
That is, the restriction $\omega_p$ is a completely antisymmetric map $\omega_p : T_p M \times T_p M \times \cdots \times T_p M \to V$.
By $\operatorname{tr}(\omega)$, we just mean the composition $\operatorname{tr} \circ \omega$. We just feed whatever the differential form gives us into the trace operation. It is a real valued differential form.
Now, if you also have a multiplication defined on $V$, as will be the case if there is a representation (just ordinary matrix multiplication), you can also define the wedge product $\wedge$ analogously to the real-valued case, just inserting the $V$-multiplication instead of the ordinary scalar multiplication.
As Mariano already explained, it satisfies the Leibniz equation.
Mariano also explained that tr is linear and therefore we can pull the $-$ through the trace.
To your special cases: Be careful with Lie algebra valued differential forms! There are at least two possible $\wedge$ products, depending on whether you define it upon multiplication in the adjoint representation or the Lie bracket! The difference is normally only is a factor, but still one should be clear about what $\wedge$ one uses. So please clarify this.