Wait, I'm confused... not the OP but if this guy is coding for this business (the one he doesn't have an H1B for), I thought it didn't matter if he was getting paid or not. This is "productive work" right? As in, it has value so is problematic. Or do I misunderstand the rules?
In the spirit of the law/regulation that's even worse: as an immigrant without permit to do that, he'd provide unpaid labor undermining ability of other people compete for this job.
Edit: of course IANAL. And in other words, as I understand it, work permits limit strictly to what extent can you affect competition in the country (H1b - only one FT job position). And by filling in vacuum of required labour somewhere else you definitely affect it negatively.
Is this considered like providing services?