“Does a building permit issued by a municipality constitute a legal contract for the building inspector and municipality to require any state or federal building codes be followed by the licensed builder as building progresses?”
I’m not quite clear on what you’re trying to accomplish, here, but the answer to your question is probably no.
You might think that a building department would be responsible for ensuring that building is done to code, and that is true in the sense that it is their job. However, building departments are arms of the government, and as such are protected by a doctrine known as “sovereign immunity.” In a nutshell what that means is that if the building department doesn’t do their job, you can’t sue them for it.
So yes, it is their job to do these things, but you can’t enforce that fact.
Your recourse, should something go wrong, is against your contractor (and possibly any subcontractors involved). Which is why it is important to use contractors who are properly licensed, and who have adequate and appropriate insurance.