LCD flickering with ethernet

in the old code you have a blocking delay(3000) in each loop iteration.

in the new code you "return" if no client is connected. so the loop will start from new.
This will happen several times per seconds.
each time you do a lcd.clear().
So it is very obvious, that your LCD is flickering.

Write a LCD update routine and only call it for example each 3 seconds.
Blink Without delay shows you how to deal with millis().
Get rid of your delay in loop()