闹着玩 can be lighthearted or dismissive. Adding 的 (de) at the end makes it explanatory: 我闹着玩的 (I was just messing around). It's often used to downplay something that upset someone.
mistakes
Don't confuse 闹着玩 (fool around playfully) with 开玩笑 (kāi wánxiào, to joke/kid). 闹着玩 implies physical playfulness or not being serious about something; 开玩笑 is about verbal jokes.