Yep. I just tested your theory; I tried EVAing Kerbals that were in orbit, and checked back on the crew roles in IVA mode. If the order was (say) Jeb, Bob and Bill, with Jeb being the commander, once Jeb EVA'ed, Bob would become the commander. Even if Jeb re-entered, Bob would still be the commander. However, if Bob then EVA'ed, Bill would become the new commander! Too bad I don't know enough coding to be of any use to anyone! This would definitely be something that would be interesting to work on! I guess for the time being I'll just stick with what I have.