Can officially retired doctors still get license to work the occasional hours?

No. Medical licenses are all or nothing - no state has a part time license. If a retired doctor wants to practice such as in a charity clinic, he will need a full license. He also has the issue of malpractice and will have to pay for that even if he is doing selfless work.