What you need is
$("#block").hover(function () {
$(this).css("opacity", "1");
}, function(){
$(this).css("opacity", ".5");
});
Demo: Fiddle
The mouseover
does not work like that, the code that is suppose to run on mouse over has to be in the callback function passed to the event.
In your case you need to change the opacity to 1 when mouser enter to #block and it has to changed to .5 when mouse leaves, for this purpose you can use the .hover() event handlers