The vet was correct, just let him shed again and it will be all in the past. Just make sure that the enclosures temperatures are right (88-92 on the hot side and 78-82 on the cool side) and that you maintain the humidity between 40% and 60% normally. When his eyes turn blue bump up the humidity to 60% to 80%.
There are other things that can cause a snake to rub against things, but if the temperatures and humidity levels are correct, he doesn't have mites and the enclosure is clean and of proper size you shouldn't be worried unless this continues after he sheds again.