Again H1 extension ( as in filing extension petition on I129 form ) and filing for extension of status(I539) are two different things. Let me take same example as you:
Let say pettion is valid till Dec 2011 and I94 till Oct 2011. Then Mr.X can file extension of status on I539 form using existing I797 and USCIS will give him I94 till DEC 2011.