Issuing an alert () in javascript from an echo () in PHP is not a good practice and does not allow any kind of additional configuration, such as adding the effects you want.
The only advantage of the method you used is that redirection will only occur after alert () is closed, since it has modal behavior and therefore leaves the browser stopped while it is not being answered.
One solution that would allow a bit more customization would be to use, for example the jquery UI. As in the example:
<?php
session_start();
$credito = $_GET['credito'];
$soma = @$_SESSION['valor_total'] += $_GET['valor'];
if($soma <= $credito){
header('Location: ../../painel.php');
} else {
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Aviso</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.9.1.js"></script>
<script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<script>
$(function() {
$( "#dialog" ).dialog({
dialogClass: "no-close",
autoOpen: false,
show: 'fade',
hide: 'fade',
modal: true,
buttons: [
{
text: "Retornar",
click: function() {
location.href='../../painel.php';
}
}
]
});
});
</script>
</head>
<body>
<div id="dialog" title="Ocorreu um problema!">
<p>Desculpe, ultrapassou seu limite de crédito!</p>
</div>
</body>
</html>
<?php } ?>