goofin'

What does it mean when someone says that someone is goofing on something. I’ve heard it in several contexts but the one that pops into my head is from LA Confidential. Right before the Movie Premire Drug Bust, Danny Devito come back from looking in the window and says something to the extent of “They’re just in there goofin on a Christmas tree.”

while we’re at it, can someone explain what Spunky means too?
often wondered what that word supposed to describe;j