you were detained on a first visit? That's unlucky, are you sure you didn't accidentally admit to intending to work or something like that?
I told them I intended to work on my company and they weren't bothered by that. They were mostly concerned that I didn't have a job elsewhere that I would have to go back to.
But you are right, it is a matter of luck.
Getting a visa may save you a lot of trouble. You really don't want to spend a night in a California immigration facility with MS-13 gang members [1].
I think to play the VWP game, you need to have weighty social and economic ties to your home country. A full time job is good. Luckily my business has deep roots in the UK so I think I should be ok.