It's perfectly legal for a keeper to do whatever he wants, as long as he doesn't move off his line. See Jens Lehmann. He moves plenty, blatantly jumping from side to side to try and throw off the taker.
As for diving before the kick is taken, AFAIK that's legal too. If anything, it makes the penalty even more of a lottery than diving slightly after the kick is taken.
Let's take the case to extremes: The keeper starts to dive 5 seconds before the kicker touchs the ball. He's a crumpled heap on the ground while the guy's still running up. The kick is taken and obviously the penalty is converted. I know it's never gonna happen, but if it did, the referee is not going to order a retake because the keeper dived before the kick was taken.