You can say those phrases using the (어떤) 뜻으로 (말)하다 pattern.
- I didn't mean that in a bad way = 나쁜 뜻으로 한 말[행동]이 아니었어요. (말 = remark, 행동 = action).
- I meant that in a good way = 좋은 뜻으로 [의도로, 의미로] 한 말이었습니다. (뜻 = 의도 = intention, 뜻 = 의미 = meaning)
(other related phrases)
- I didn't mean it / I didn't do it on purpose = 일부러 그런 게 아닙니다 / 일부러 그럴 의도는 아니었습니다.
- I had no ill will = 나쁜 뜻은 없었습니다.