I would say way too many lines for one method, I try to aim for 4-5 lines of codes per method*. This tight limit ensure that your functions are doing one thing, and is following the rule of singled responsibility principle from S.O.L.I.D. principles. This functions is setup a new game when game state deems it, check if Input is the correct word than ends the game, if the input isnt the correct word than the function figures out which error message to display, and then check if you have lost the game. Wow that is alot of things for a function to do.
So i would try extracting some of this logic into their own functions so that OnInput responsibility is only calling other methods/functions(yes calling method is a responsibility).
function OnInput(FString input)
{
If(ReStartGame()) return;
if(IsInputCorrect(input) return;
--life; //If the input isn't correct than well we take a life away no matter
ShowInputErrorMessage(Input);
SouldEndGame();
}
*sometime you just cant get a method down to 4-5 lines of code.