Molecular nanostructures are promising building blocks for future quantum technologies, provided methods of harnessing their multiple degrees of freedom can be identified and implemented. Due to low decoherence rates, nuclear spins are considered ideal candidates for storing quantum information, while optical excitations can give rise to fast and controllable interactions for information processing. A recent paper [M. Schaffry et al., Phys. Rev. Lett. 104, 200501 (2010)] proposed a method for entangling two nuclear spins through their mutual coupling to a transient optically excited electron spin. Building on the same idea, we present here an extended and much more detailed theoretical framework, showing that this method is in fact applicable to a much wider class of molecular structures than previously discussed in the original proposal.