I had heard that if the gun owner is present while the work is being done and had not left the gun until that time, then it was ok. I can't say for sure .
If you making a living as a gunsmith even if the work is slow limited or Al most nonexistent you have to have one of the many FFLs to be legal. If you work on a friends gun you can also get into trouble if the feds push the issue. Oddly there appears to be some loopholes. One actually is part of the rules. If the work is begun and finished in the same calendar day it can be argued that your not a gunsmith. The possible loophole is the law that allows us Okies to sell guns privately to each other. Possible example. If a good fixit guy buys your gun for a reasonable price and makes some changes to it and you see it and like it so much you just ha emo buy it back. If this could be done is suspect it shouldn't be the normal way to do business.
Just get the FFL and make it legal.