This is an explanation of the flags and the way you can refer to them.

The token _FLAG_ is written in the following order:

_FLAGS_ = "*XAD",

Where "X" is one of "N", "U" or "R" (in particular _FLAG_ can never be empty) So for a message that has been read and not deleted, or other flag set, the value of _FLAG_ is "R", if you mark it deleted, its value will be "RD", if you answer to that message its value will be "RAD", if you flag it new, its value will be "UAD", if you now mark it Important, its value will be "*UAD".

I have integrated this patch with the flags patch, in this form one can use your rules to save messages according to the custom flags that you have defined on them. Also, you can flag messages so that they won't be moved from INBOX upon exitin Pine, which is quite handy. These two patches combined are very powerful. If you want to have this two patches integrated contact me.