There are some restrictions on what you can do in OSL ,you you can't create your own BSDF or trace your own shading rays currently. There is a raytrace function for things like ambient occlusion or other tricks, but the integrator and sampling is generally outside of the control of OSL shaders.
This is part of the OSL design, the shader describes the material or light behavior but does not describe how the integrator and sampling should work specifically. For example the renderer may do multiple importance sampling, bidirectional ray tracing, photon mapping, .. and all those methods should work with the same OSL shader.
The questions you ask seem to involve specific algorithms, in a physically based render engine creating rays is generally the job of the integrator which can make smarter decisions at a global level rather than each individual shader doing their own sampling.