For prototypes and one-offs, clever. For production, there are risks. You are relying on the solder mask for isolation. That is a safe assumption, unless the board sees vibration. In that case, the unsoldered pins could rub off the mask. Also, the soldered pins are lifted by the solder mask under non-soldered pins. That probably helps solder flow between the pads and pins you want to solder, but it is still something the process is not calibrated for. I would show the detail to manufacturer and ask their opinion before ordering ten thousand of those.
But a very clever trick that I keep in mind. Tricks like that sometimes make the difference of four amd two layers or even one or two layers, which is crucial for diy boards. Thanks for sharing!