Question about retarget system bitcoin, add hardcodet block to exist blockchain the standard values

    if (nActualTimespan &lt; params.nPowTargetTimespan/4)
        nActualTimespan = params.nPowTargetTimespan/4;
    if (nActualTimespan &gt; params.nPowTargetTimespan*4)
        nActualTimespan = params.nPowTargetTimespan*4;


but if i use 

        if (nActualTimespan &lt; params.nPowTargetTimespan/4)
            nActualTimespan = params.nPowTargetTimespan/4;
        if (nActualTimespan &gt; params.nPowTargetTimespan*2)
            nActualTimespan = params.nPowTargetTimespan*2;


It's be valid or it's can broke diff system ? 

What values can i add for diff is not grow very quickly, but drop faster than grow for it be more stable for fast block time. 

setting of block time is

consensus.nPowTargetTimespan = 10 * 60; // 10 min
consensus.nPowTargetSpacing = 5 * 60; //5 min


And another question

I try use the exist function low diff block what created for testnet for only block with Height 2001 .
Previous exist block is 2000  and latest now in blockchain.

if ((pindexLast-&gt;nHeight+1) % params.DifficultyAdjustmentInterval() != 0)
{
    if(pindexLast-&gt;nHeight+1 == 2001)
    {
        // Special difficulty rule for testnet:
        // If the new block's timestamp is more than 2* 10 minutes
        // then allow mining of a min-difficulty block.
        if (pblock-&gt;GetBlockTime() &gt; pindexLast-&gt;GetBlockTime() + params.nPowTargetSpacing*2)
            return nProofOfWorkLimit;
        else
        {
            // Return the last non-special-min-difficulty-rules-block
            const CBlockIndex* pindex = pindexLast;
            while (pindex-&gt;pprev &amp;&amp; pindex-&gt;nHeight % params.DifficultyAdjustmentInterval() != 0 &amp;&amp; pindex-&gt;nBits == nProofOfWorkLimit)
                pindex = pindex-&gt;pprev;
            return pindex-&gt;nBits;
        }
    }
    return pindexLast-&gt;nBits;           
}
else
{           
    if (params.fPowAllowMinDifficultyBlocks)
    {
        // Special difficulty rule for testnet:
        // If the new block's timestamp is more than 2* 10 minutes
        // then allow mining of a min-difficulty block.
        if (pblock-&gt;GetBlockTime() &gt; pindexLast-&gt;GetBlockTime() + params.nPowTargetSpacing*2)
            return nProofOfWorkLimit;
        else
        {
            // Return the last non-special-min-difficulty-rules-block
            const CBlockIndex* pindex = pindexLast;
            while (pindex-&gt;pprev &amp;&amp; pindex-&gt;nHeight % params.DifficultyAdjustmentInterval() != 0 &amp;&amp; pindex-&gt;nBits == nProofOfWorkLimit)
                pindex = pindex-&gt;pprev;
            return pindex-&gt;nBits;
        }
    }
    return pindexLast-&gt;nBits;
}


And use new rule retarget for new block's after 2001 and accept old block with old retarget rule.

   if(pindexLast-&gt;nHeight+1 &gt; 2001)
    {
        if (nActualTimespan &lt; params.nPowTargetTimespan/4)
            nActualTimespan = params.nPowTargetTimespan/4;
        if (nActualTimespan &gt; params.nPowTargetTimespan*2)
            nActualTimespan = params.nPowTargetTimespan*2;
    }
    else
    {
        if (nActualTimespan &lt; params.nPowTargetTimespan/4)
            nActualTimespan = params.nPowTargetTimespan/4;
        if (nActualTimespan &gt; params.nPowTargetTimespan*4)
            nActualTimespan = params.nPowTargetTimespan*4;
    }


About what i asking , is this solution is right and it will work, or this solution is wrong end exist another way to do this ?
if (nActualTimespan &lt; params.nPowTargetTimespan/4)
        nActualTimespan = params.nPowTargetTimespan/4;
    if (nActualTimespan &gt; params.nPowTargetTimespan*2)
        nActualTimespan = params.nPowTargetTimespan*2;


This does the opposite of what you want. It increases the difficulty quickly, but decreases the difficulty slowly.

Here's what you meant to do:

    if (nActualTimespan &lt; params.nPowTargetTimespan/2)
        nActualTimespan = params.nPowTargetTimespan/2;
    if (nActualTimespan &gt; params.nPowTargetTimespan*4)
        nActualTimespan = params.nPowTargetTimespan*4;