int bnNew = 2*Current - Median - (Current - Median)*nTargetTimespan/nActualTimespan;
then if Median is equal to Current... then bnNew will be equal to Current no matter what nActualTimespan is. Even if nActualTimespan is close to zero the new complexity threshold will not be changed.
Maybe you just have found a vulnerability in Motocoin. To ensure that new blocks are mineable it will never make target time less than median and you found a way to exploit it.