In UCI you would send a comment 'go infinite' after setting up the position to analyse with the usual 'position ... moves ...' command. Terminate with 'stop' before sending any other commands.
In CECP the command is 'analyze', and you terminate that with 'exit' (which brings you back into force mode). In CECP it is allowed to send 'setup' commands, moves and 'undo' during the analysis, after which the engine starts searching the new position.
In both cases the 'thinking output' is as usual. Meaning that in CECP you might need to send a 'post' command to make sure it will be given.
Looks OK. But it would probably be better to send the move(s) ("usermove e2e4" after "force") rather than the position (through 'setboard'), so that the engine has the complete game hsitory in addition to the current position. This could make a difference for repetition draws, which it otherwise would not recognize.
Also notice that you just assume here that the engine will understand 'setboard' (and I assumed that the plain move needs to be prefixed with 'usermove'). This might not be the case for all engines, and it should formally be deduced from the 'feature' replies to 'protover 2' whether you have to send positions with 'setboard' or 'edit', and whether the 'usermove' prefix is necessary for relaying moves.