i dont think DD knew exactly what was going to happen, or even who was coming up the stairs, after all, harry didnt see draco til after he was immobilized. i think he immobilized harry to protect him, in case it was someone who would kill harry, like maybe voldemort. he had no idea if the death eaters were still in the castle or gone, and for all he knew Voldemort could have gotten impatient and come to the school and found a way in (whether through force or through help) and he wanted harry to be safe, in case it was voldemort. (the dark mark was present, and i am sure dumbledore was assuming the very worst case scenario: Voldemort got into the school, despite his protections, and had killed someone). this said, DD may have immobilized harry so that harry could live to fight another day. DD is an acclomplished Occlumens, and i would assume he would be able to lie to voldemort, and thus could say that Harry had run away from the school, or something and there would be no way for voldemort to know that harry was right there under his nose.
so, DD immobilized harry so that harry would be protected. since harry couldnt move, he couldnt make any noise (in case it was voldemrt, harry wouldnt be able to try to sneak out the door or, more harry like, attack voldemort directly and get killed) and thus, since harry is like a lamp, and unable to make noise, DD lie of saying he is all alone becomes more valid.