Igorsrt,
вы тэг style не вставили в код.
<?php
echo " <style type=\"text/css\">
.selected {
width: 50px;
}
</style>";
echo "
<li class=\"shipping_method\">
<input type=\"radio\" name=\"shipping_method[0]\" data-index=\"0\" id=\"shipping_method_0_flat_rate\" value=\"flat_rate\" class=\"shipping_method\" checked=\"checked\"><label for=\"shipping_method_0_flat_rate\">Dostavka1</label><div style=\"float:right;\">300 rub</div></li>
<li class=\"shipping_method\">
<input type=\"radio\" name=\"shipping_method[0]\" data-index=\"0\" id=\"shipping_method_0_local_delivery\" value=\"local_delivery\" class=\"shipping_method\"><label for=\"shipping_method_0_local_delivery\">Dostavka2</label><div style=\"float:right;\">250 rub</a></div></li>
";
echo "
<script src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js\"></script>
";
echo "<script>
$(function(){
$('input.shipping_method').click(function() {
$('input.shipping_method').each(function(indx, element){
if (this.checked) {
$(this).addClass('selected');
} else {
$(this).removeClass('selected');
} });
}).filter(\":checked\").click();
})
</script>";
?>