You are writing the two nibbles already, just add a line to write the colon to the buffer after you write the second nibble in your for loop. Make sure to use buffer[i+3+0] , buffer[i+3+1] etc.
BTW: buffer[len*2] is wrong, you probably meant buffer[len*2-1] instead. Make sure to also change this to buffer[len*3-1] if you add the colon after the bytes.
Edit: sorry, my last paragraph is wrong. Don't subtract 1 ...
void array_to_string(byte array[], unsigned int len, char buffer[])
{
for (unsigned int i = 0; i < len; i++)
{
if (i == 0)
sprintf(buffer, "%02x", array[i]);
else
sprintf(&buffer[i*3-1], ":%02x", array[i]);
}
}
void array_to_string(byte array[], unsigned int len, char buffer[])
{
for (unsigned int i = 0; i < len; i++)
{
if (i == 0)
sprintf(buffer, "%02x", array[i]);
else
sprintf(&buffer[i*3-1], ":%02x", array[i]);
}
}