Depends on your definition of "legal." It'd still be "work." You need to think whether a US border agent would let you in if you told them the truth. I once told an agent I was going to help a friend set up who'd just moved into a new house.. even that got me in the interrogation room!
You need to have your entire story planned out before you get to the agent whether your entry is for legitimate purposes, arguable purposes, or illegitimate purposes. It doesn't matter which - and then stick to it.
I go to the US legitimately, and often they throw some real curveballs that, if you hadn't got a clear picture in your head, could get you into trouble fast.