Replacing the 6 lines in the middle with these should do the trick
Console.ForegroundColor = borderColor;
Console.Write("{0,-" + (Console.WindowWidth - message.Length) / 2 + "}", borderChar);
Console.ForegroundColor = messageColor;
Console.Write(message);
Console.ForegroundColor = borderColor;
Console.Write("{0," + ((Console.WindowWidth - message.Length) / 2 + message.Length % 2) + "}", borderChar);