You might try adding a
$STDIN->WriteInput(1, FALSE, 1, 1, 1, 0, 0)
after the ->WriteInput(1, TRUE...) to simulate a full keypress, not just a key-down. Also, you could try actually finding out the VK_ code for ENTER and use that rather than just using 1.