imap: Tidied up the LIST response function

Reworked comments as they referenced custom commands, removed
unnecessary state change on failure and setting of result code on
success.