RFID Doorlock with servo and i2c lcd

Ok, great. so i got the display working and replaced some of the Serial.print with lcd.print(i left debugging and setup for serial).
now i have another problem: i need the lcd to recognize when there are more than 16 characters and drop to the 2 line. i find the following piece that does this:

void loop()
{
int charcount;
boolean secondline;
if (Serial.available()) {
delay(200);
lcd.clear();
charcount = 0;
secondline = false;
while (Serial.available() > 0) {
if (charcount > 15 && secondline == false ) {
lcd.setCursor(0,1);
secondline = true;
}
lcd.write(Serial.read());
charcount++;
}
}
}

Problem is, i don't know how to implement this piece so it will run continuously within the code.
How should i continue?

what i have until now attached

RFIC door lock - no 2nd line drop.cpp (20.5 KB)