戯れに触れれば融け行き、悪戯に払えば散りゆく。 かといって、お為ごかしに見過ごせばいずれは消えていく。
For context we're talking about snow here.
From what I know, に when used with a verb stem indicates a purpose. So 「戯れに触れれば融け行き、」 would translate to "If we touch it to play it's going to melt".
「悪戯に」 is giving me more trouble. I think the に is turning it into an adverb so the second part of that sentence would loosely translate to "If we casually dust it off it's going to dissolve."
I don't understand the function of the に in the third sentence. It looks like it means "On the other hand, if we overlook it under the pretense of being kind it's eventually going to disappear." but what is the usage of に here?
I'm pretty sure I'm making mistakes so any clarification is appreciated. Thank you.