How can I force users to fill in a custom field when it’s empty

To that specific question, assuming that an unanswered question will be NULL in the database, you can just replace where.not(value: [nil]) with where(value: nil).

You can also use where(value: [nil, ""]), which is equivalent to WHERE (something.value IS NULL OR something.value = "") in SQL, to search for an empty string or NULL. I’m not sure which it’s likely to be or if it’s likely to change (from NULL to “”) if a user submits an empty field.