You've got alot of message_begin() there and I don't see how any of those might be the problem, so, like fysiks said, post the entire error with debug mode on so we can see line number.
A side note, you might want to create a global variable (msgid_statusicon or something) that stores get_user_msgid("StatusIcon") on plugin_init() and use that variable on message_begin() because you'll omit calling get_user_msgid() every time :}