Is there a way to change order of blocks before page load (according to current node id for expample)? In hook_preprocess_page or something like that? I don't want to use any modules for this.
You can use hook_block_list_alter to achieve this. Be aware that the
$block->weight attribute won't be affected at this point in the proceedings, but there are solutions in the comments to this problem.