I had the same requirement since the extra
</p> were causing thumbnail misalignment on my blog list page.
My simple solution was to get rid of
</p> from the thumbnail before showing it. This can be done in
$thumbnail = $lines;
$lines = $thumbnail;
Put those lines before this line:
$lines = array_slice($lines,3);
Hope this helps.