what to do in 2 year gap before CS PhD
A software engineering position probably doesn't improve your competitiveness for graduate school, unless your graduate school wants you to code (which isn't a requirement for a PhD in computer science). Is coding something you'd be interested in? If so, then the software engineering route would be advantageous. Perhaps more importantly, the software engineering route will make you more competitive to a research company after graduate school.