SNOBOL4 (CSNOBOL4), 148 bytes
S =INPUT
N S ARB . L ANY('aeiou') . C REM . S :F(O)
EQ(X) :S(A)
&LCASE @P C
&UCASE LEN(P) LEN(1) . C
A O =O L C
X =1 - X :(N)
O OUTPUT =O S
END
S =INPUT
N S ARB . L ANY('aeiou') . C REM . S :F(O)
EQ(X) :S(A)
&LCASE @P C
&UCASE LEN(P) LEN(1) . C
A O =O L C
X =1 - X :(N)
O OUTPUT =O S
END