Here is my version:
ClearAll[nbLines];
nbLines[nb_NotebookObject] :=
Count[
Characters@StringJoin@Cases[
Cases[NotebookGet[nb],With[{inputs =
Cases[NotebookGet[nb], Cell[BoxData[data_], "Input", ___] :> data, Infinity]
},
Length[inputs] +
Count[Characters@StringJoin@Cases[inputs, _String, Infinity],
"\n" | "\[IndentingNewLine]"];"\[IndentingNewLine]"]
]
This may not be precise (because the method of input extraction is not totally robust), but should be good enough for qualitative estimate.