Does exists some console utility for keyboard layout switching in Mac OS X?
Ok. I wrote it myself.
If you need one see code of utility here (https://github.com/myshov/xkbswitch-macosx) if you want in bin directory there is already compiled version.