I don't know if there are any particular obligations associated with STA-21, but I would imagine it's like any other comissioning program - you're obligated to time-in-service, not a particular designator.
As for how switching jobs is "looked upon," short answer: it depends what you're switching between. I assume since you're posting here, you're either going for aviation, or you've got something else and want to go aviation later.
You compete for advancement against all other officers in your year group, but you compete for dept head, command, etc, against others in your community. How your "old jobs" help or hurt you is really up to the opinions/prejudices of the officers on those boards.
You're expected to meet standard career "gates" (the checks in the block) when you go before a board, and if you did something non-standard but equivalent to those gates, it might not make much difference. If you did a bunch of other things instead of the standard career track, it might be frowned upon.
That being said, there are some designators, such as AEDO or the new HR community, where pretty much everyone is expected to have come from somewhere else. The boards for those guys have a sort of apples-and-oranges process to go through, but they're also very small communities.
In general, it's near-impossible to say very far in advance what will help or hurt your career. Communities go through fads, or phases, where the selection boards like or don't like something. An awesome skipper I used to have went to Fallon for his JO Shore tour, back when Hawkeye guys didn't go to Fallon. Everyone told him it'd kill his career; but then, of course, Top Gun and CAEWWS moved out there and by the time he was up for command, it made him look like a front-runner.
Your best bet is, if you're going to switch communities, do it early on in your career. The longer you spend doing one job, the tougher you'll find it to switch to another.