Personally, I think the method you suggested would work as per the CAD diagram you posted You'd want a multi-stage spur gearbox to make it work rather than a planetary if horiztonal space is an issue.