The ID came with the work permit/visa, drivers' license also took some time.. actually it took ages, and I had to hand over everything when I left. My stuff (incl. bike) took a full month to cross border control on the way out, and obtaining the authorization to export the bike took some weeks as well.
As far as buying goes, you may be able to find a used KTM Adv for example, other than that there are a few shops selling used bikes, not many, one in particular in Shoubra on the road to Heliopolis, and another one in Port Said that I've visited once. There's a Honda dealership on the ring road next to the Mubarak Police Academy (must have changed name by now), and some remotely located Kawasaki shops, as well as one KTM dealer in Heliopolis, with a shop in Sharm.
On the used market, apart from sport bikes in the vicinity of Maadi, they are not easily available, and NOT cheap in Egypt because of the hefty import tax. They usually are in very poor condition as there are no real bike shop for maintenance and mechanic, not even parts with tires, apart from the Harley shop and another one that I never tried.
Just be ready to face the worst possible bureaucracy, it's entirely arbitrary, costly, inefficient and painful. But riding in Egypt is worth every single penny and time spent getting the papers right.