Un par de cosas:
1) El objeto debe tener posicionamiento absoluto.
2)Falta la unidad px.
3)Los condicionales se contradicen.
Probá así:
Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin título</title>
<script>
var avanceh=2,avancev=2;
function muevebola(bola) {
if( parseInt(bola.style.left) > 930 || parseInt(bola.style.left) <130){
avanceh=-avanceh
}
if( parseInt(bola.style.top) > 650 || parseInt(bola.style.top) <190){
avancev = -avancev;
}
bola.style.left = parseInt(bola.style.left) + avanceh+'px';
bola.style.top = parseInt(bola.style.top) + avancev+'px';
setTimeout(function(){muevebola(bola);}, 10);
}
onload=function(){muevebola(document.getElementById('bola'))}
</script>
</head>
<body>
<div id="bola" style="width:20px; height:20px; background-color:#F00; position:absolute; top:190px; left:130px"></div>
</body>
</html>