It appears that such work is cod ecompliant.

The NEC should reconsider the use of NM cable in blown foam insulation in walls but until they do ...