From my perspective....
Illegal means something is there that cannot be there.
Non-permitted means that something is there that can be there but hasn't been permitted.
This is a huge difference.
As-is market value exists for improvements that are illegal (cannot be there) and for improvements with non-permitted alterations (can be there but haven't been permitted).
If the improvements truly represent an illegal use, then if one is performing a GSE report, one better check "illegal" in the Zoning Compliance section (page 1 of the 1004).
One also better describe the situation and determine what the H&BU as-improved is.
When something is illegal (cannot be there), H&BU as-improved will likely find there are two options: (a) remodel (which technically means changing the use or utility) or (b) demolition.
Since, for market value appraisals, we value the property to its H&BU, then a property with an illegal use would be valued based on the impact of "a" or "b" above.
For GSE work, they will not make a loan on a property with an illegal use. That doesn't mean the client won't want an appraisal anyway, but if they do want an appraisal, then the as-is market value for an illegal improvement must consider the impact of a remodel or would conclude that the H&BU is to demolish the current improvements and return the site to its vacant, ready-for-development status to be developed to its H&BU (in the case of demolition, the assignment then becomes a tear-down/land valuation problem to be solved).
Zoning/planning departments (assume the subject is under such a jurisdiction) will tell the appraiser if the use is illegal, or if the situation is a permit issue.
To arbitrarily give "no value" (not analyze the impact of the as-is condition) in an assignment that requires an opinion of market value is fundamentally incorrect.
One should also consider to what degree the jurisdiction actually enforces the codes if this is a "needs permits" situation. In some cases, the enforcement is so infrequent that the market has no reaction. If that is the case, that is the conclusion I'd make. But I'd be sure to discuss it in my report.
If the use is truly illegal, then IMO the degree to which the a jurisdiction may pursue a remediation doesn't factor into my analysis (although I'd comment on it). Illegal is illegal, and I'd analyze the property as such.
Sometimes, the non-permitted condition is easily rectified such that there is no impact on value.
Sometimes, the non-permitted condition is not so easy to rectify; that would presumably have an impact on value... but not always (think of an extremely hot market where buyers are many and options are few... in such markets, impairment issues that otherwise would create discounts in price get squeezed and sometimes disappear).
In either situation, the appraisal report must accurately describe what exists. Then, the appraisal report must walk the client/intended user through the process it used to determine what to do next (value the property as-is with a non-permitted alteration or value the property as-is, as an illegal use, based on the H&BU as-improved conclusion).
The first step is to determine "illegal" or "non-permitted".
The next step is to contact the client and inform them of the situation and ask if they have any particular guidance or protocol. When asking the client, I assume that the response from the client is something that can be done in a USPAP compliant manner. So, a response of
"Just give it no value" isn't USPAP compliant.
"Go ahead and value it as-is" is USPAP compliant but could significantly change the nature of the assignment. An appraiser may want to ask for more time, a different fee, or determine it is beyond their competency (or simply determine they don't want to do it): all those options ("give me more time", "give me more money", "send it to someone else") are appropriate and I wouldn't hesitate to exercise any one of them.
You will hear an alternative views that argue when an alteration isn't permitted and permits are required, that constitutes an illegal use. I disagree with that argument but you may be in agreement with it. If you are, then you'd have no choice in an as-is appraisal to check the "illegal use" in the zoning compliance section. And, if you conclude it is an illegal use, you should contact your client because chances are very high they will tell you to stop and bill them for the work you've done up to that point.
In theory and in practice, the determination of the legality of the use should be one of the first things done after the point where the question was raised. So, if you found out in your pre-interview of the borrower that they did something which you believe creates an illegal use, you should verify it at that stage. If you discover it at the inspection, you should make your determination before you finish the report.
And to reemphasize, unless the client has clear guidance in their engagement agreement and assignment conditions, you should contact them in the case of a non-permitted issue and contact them without fail in the case of an illegal use issue before you complete the report.
Good luck!