。
Don't do that halfheartedly.
Literal
Play-half-[with-で] that-kind-of thing do-[negative-imperative-な].
遊び半分で ('half-jokingly, with a playful attitude') uses で to mark the manner or state — the way the action is being performed. そんな事 ('things like that, that kind of thing') is a casual deictic. The whole sentence is a rebuke aimed at attitude: don't approach this with a half-playful mindset.