The custom close reason is a sub-reason of off-topic.
You'll use it if none of the other pre-baked off-topic reasons or migration targets can explain why the question doesn't fit on Stack Overflow.
Remember that closing means that the question can't or shouldn't be answered in its current form. It needs to be improved by the OP or deleted.
If we assume we don't want to risk losing a potential good question, the custom close reason should give the OP enough guidance to either edit their question into shape or decide to delete it all together.
When you are a regular on a different site that is not a migration target you can suggest to see if the question fits on another site in the SE network.
For the licensing/legal related questions there are some custom reasons around mainly because legal stuff somehow is related to programming but we prefer to keep that off-topic.
In that respect
I'm voting to close this question as off-topic because SO isn't a code writing service.
isn't good use of the custom close reason. Either 'Unclear' or 'Too Broad' are better in these cases. Both close reasons have links to the Help center in their close notice, so that should help the OP determine why their question was closed.
Telling what Stack Overflow isn't can be a long list. If you use comments or a custom close reason make sure they are respectful to the OP (be nice) and explain what Stack Overflow is. That is hard enough.