"They use custom code to highlight pages on header to show current page and to use hover effect."
The code I provided has the same features. Blix is quite an old theme and WP may not have been adding the classes to the code as they do now. I use it on my site just fine with both hover and selected states working fine.
"The code you are giving me is for displaying pages in sidebar. I am talking of header code."
I use this code in my header. You can put the code anywhere you like and it will work exactly the same. This will work. You may have to change a css class or two but this way it is compatible with both WP versions. The only other way I could see you overcoming this problem is to write some custom if statements that check for WP version. Seems a little silly though.