M.P.
I urge you to plan a schedule and stick with it. What he's claiming is not reasonable unless he has a health issue, perhaps chronic constipation. I would not let him sit on the toilet for an hour. If he doesn't go in the first 10 minutes he's not going to go. Take him off the toilet and put him to bed.
You know that he poops twice before midnight. This means he needs to be trained to poop earlier in the day. I would not be so sure it's not a constipation issue. If he's trained himself to not respond to his bodies signal during the day he's constipated. Then when he focuses on needing to go his body responds. It sounds like he's holding it until night time.
Treat this similar as potty training. Take him to the toilet and have him sit there 10 minutes or so. Only 10 minutes. Do this several times during the day if he's with you.
Know that we all naturally poop within an hour or so after we eat. So take him to the toilet then. I also suggest that if he didn't poop so late at night he'd poop first thing in the morning. If he's not with you during the day, get him up earlier, feed him, and sit him on the toilet. Feed him and put him on the toilet when you get him home. Put him on the toilet every hour until he poops. Change his routine.
You don't mention fluids. He needs to drink several glasses of liquid during the day. His poop needs to be soft in order for him to poop easily. What is the texture of his poop? If it's really firm or in more than 2 pieces I suggest he needs more liquid in his diet.
I would talk with the pediatrician about giving him Miralax until you're able to get him on a different more reasonable schedule. Talk with the doctor about this.
I suggest that if you make changes to his routine he can be trained to poop earlier in the day. A part of this is to think about whether or not there's an emotional side to this. Has he been in trouble for pooping earlier in the day? Is he afraid to poop while at school? Is pooping an emotional experience for all of you. He'll feel your tension, wanting him to poop and be less able to poop. Deal with the emotional aspects of the situation, too.
I would not think he's doing this to prolong his wakefulness. It is not pleasant to be awakened in the night by the need to poop nor is it pleasant to face your unhappiness. If he's trained himself to only poop at night I suggest that he's found pooping in the daytime an unpleasant experience. Whatever you do make pooping fun. And do not let him sit for an hour or until he poops. Ten minutes and he's off to play. Give him something pleasant to do during those 10 minutes. Perhaps have special books or toys for him.
More liquids. A schedule. Not more than 10 minutes. Make the time pleasant. Do not show frustration or irritation.
I read a previous post of yours stating that you son has been diagnosed with high functioning autism and ADHD. Both of these conditions can cause difficulty with bowel movements. He may not even feel the need to have a movement until his intestines get more full. I suggest that you talk with his therapists and/or his pediatrician about this issue.
I googled Pdd nos and bowel difficulties and saw several sites referring to this and bowel difficulties. I suggest that you get professional help in learning how to deal with this.