Okay, you can swap all the RB transmissions regardless of what specified RB engine. In addition, you can even use an Z32 transmission granted you have the correct bell housing. The best bet is to use an RB20 transmission or a MKII Z31 turbo transmission.
Just a thought though, if you do end up keeping an RB20 transmission, you dont really want to do much more than 350-400 rwhp. There is a range for it depends on what type of life the transmission has seen. Some have had harder lives that others so power levels are associated accordingly. This is a guideline. If you do use an RB20 transmission, it is best to keep an OEM clutch and flywheel. If you go aftermarket, you have the chance to shortening the life of the RB20 transmission.
Also, about the Z31 transmission. Reason I say MKII Turbo is that they are essentially the same as a Z32/R32 25 transmission within a housing that fits quite well into our trans. tunnel for obvious reasons. It is your best bet but they are hard to come by. I found one but due to the person's loose description of its history and the shipping costs I declined. I am currently waiting for a Z31 transmission, which a buddy of mine in the Z community thinks he has a line on.
But for now, my RB20 transmission works out quite well with the 355rwhp/285ft-lbs I am running. I dont drive hard habitually and always let the car warm up, cool down, and ease into hard driving. That will do a lot for the life span.
Then there is your question about drive shaft. That is a tricky one and I suggest you get a one-piece made up for your car. That very much depends on a couple things. First, your placement of the engine. Although all our RB swaps will have the engine sitting in the same general area, small distances can throw things off when measuring distance. Second, the differential you may have. The S12 came with three different diffs: H190, R180, and R200. They will cause some differences in your drive shaft as well. All are minimal but I cannot guarantee you one answer for all three sets.
Also, for more information that may be of assistance - RB swap into an S12 write up I did:
http://www.s12silvia.com/community/index.php?showtopic=5441