At Options:IRC:Logging is a checkbox "strip codes". All control codes (like colors) will be logged if you uncheck it, so you can see the original colors if mIRC reloads a log (or a script /loadbufs a file with control codes).

Maybe I got your suggestion wrong... what do you mean with "assign a color"?