There's no guarantee of anything if you enlist, so "giving up two short years" does not mean you'll finally reach anything, necessarily. Gotta understand, no matter how smart you are or what you want to do, the Navy doesn't have to let you be an officer. I've seen several very sharp petty officers who had everything going for them - bachelor's, great evals, CoC recommendations, maxed-out PRT's - get denied shots at OCS simply because they were in critical rates or had NECC's the squadron couldn't deploy without.
As long as you're a civvie, you have some control over your fate. As a white-hat in the Fleet, you effectively have none.
There's nothing wrong with being a mustang, and I know plenty of great officers who came up from the ranks. But it's a bloody terrible plan to enlist in order to become an officer, and damn near all the prior-E's here will say so.