Shifty Eyes Shifting I's
Perl, 59 56 54 bytes

Includes +1 for -p

Run with the input on STDIN, e.g. perl -p shifty.pl &lt;&lt;&lt; "&gt;_&gt; &lt;_&lt; &gt;_&lt; &lt;_&gt;"

shifty.pl:

s%^|&lt;|(&gt;)%y/iI/Ii/or$_=Ii;$1?s/i |i$/ i/:s/ i/i /%reg


Explanation

The control string alternates instructions for i and I and the rule is the same for both of them if you formulate them as:


&lt; Move left if there is a space to the left
&gt; Move right if there is a space or end of string to the right


So I'm going to swap i and I in the target string at each step so I only need to apply the rule to one letter ever. This is the y/iI/Ii/

I will walk the control string looking for &lt; and &gt; using a substitution which is usually the shortest way in perl to process something character by character. To avoid having to write $var =~ I want the control string in the perl default variable $_. And I also want an easy way to distinguish &lt; from &gt;. All this can be accomplished using

s%&lt;|(&gt;)%  code using $1 to distinguish &lt; from &gt; %eg


The target string I also want to manipulate using substitutions and for the same reason I want that in $_ too. $_ being two things at once seems impossible.

However I can have my cake and eat it too because the $_ inside the body of a substitution does not have to remain the same as the $_ being substituded. Once perl started substituting a string this string will not change even if you change the variable the string originally came from. So you can do something like:

s%&lt;|(&gt;)% change $_ here without disturbing the running substitution %eg


I want to replace the original $_ by the initial "Ii" only the very first time the substitution body gets executed (otherwise I keep resetting the target string). This replacement however also has to happen for an empty control string, so even for the empty control string the body needs to be executed at least once. To make sure the substition runs an extra time at the start of the control string (even for empty control strings) I change the substitution to:

s%^|&lt;|(&gt;)% change $_ here without disturbing the running substitution %eg


I will run the y/iI/Ii/ as the first thing inside the substitution code. While $_ is still the control string this won't yet contain any Ii, so if the transliteration indicates nothing was changed that is my trigger initialize $_:

y/iI/Ii/or$_=Ii


Now I can implement the actual moving of the letters. Since I start with a swap all moves should be done on i, not I. If $1 is set move i to the right:

s/i |i$/ i/


If $1 is not set move i to the left

s/ i/i /


Notice that at the start of the control string when I match ^ $1 will not be set, so it tries to move i to the left on the initial string Ii. This won't work because there is no space there, so the intial string remains undisturbed (this is why I put the () around &gt; instead of &lt;)

Only one problem remains: at the end of the outer substitution $_ is set to result of the outer substitution regardless of what you did to $_ inside the substitution body. So the target string with the proper placement of i and I gets lost. In older perls this would be a fatal flaw. More recent perls however have the r modifier which means "make a copy of the original string, do your substitution on that and return the resulting string (instead of number of matches)". When I use that here the result is that the modified command string gets discarded while the original $_ is not disturbed by perl and left after the substitution. However the disturbing I do on $_ is still done after perl left $_ alone. So at the end $_ will be the proper target string.

The -p option makes sure the original string is in $_ and also prints the final $_.