Can I run a romex cable not going to a switch box around the switch box as long as it is stapled at both sides of switch box. From a vertical perspective
Yes, that would be fine per 2011 NEC Article 334 Nonmetallic-Sheathed Cable: Types NM (Romex), NMC, and NMS.
334.30 Securing and SupportingNon-metallic sheathed cable shall be supported and secured by staples, cable ties, straps, hangers, or similar fittings designed and installed so as not to damage the cable, at intervals not exceeding 1.4 m (4.5 ft) and within 300mm (12 in.) of every outlet box, junction box, cabinet, or fitting. Flat cables shall not be stapled on their edge.
Even though it says every box, etc., it really means every box it enters/exits. So, assuming you follow the above you're good to go.