You’ll want to be consider the house temperature too, and keep it running if it’s too cold, and only attempt to optimise COP when warm enough. Otherwise you’ll get complaints…
I wait for the compressor to turn off naturally, and then I keep it off for ten minutes before allowing it to turn back on (if it wants to). See this thread for more on turning of heat pump between cycles: