You need to keep the first few lines because they are part of the setup but also you might have to modify the first line that you keep with some other parameters.
Have you listened to @charleyntexas explain how to split g-code:
I have not (yet) tried myself but it does not look very complex… apart from figuring out where to cut. Indeed you should err on the safe side, it’s best to cut 20 minutes of air rather than crash into the piece.