The logic here is indeed wrong. It should read:

mii->mute ? " [muted]" : ""

But you don't need to adjust mii->muted. At that time, only a request has been sent to pulseaudio that we would like to mute the sink. Once the sink is muted, pulseaudio will trigger an event and the mii structure gets updated (see pulseaudio_event_cb() in src/pulseaudio.c).