Rainbows are purely aesthetic objects used for scenery. It doesn't provide a barrier, as it is not solid.
Here, rainbows produce a slightly different object. It is a swirly orb colored as a rainbow. When released it creates a rainbow that spreads diagonally upwards and downwards. Color and size adjectives affect it.
In Scribblenauts Unlimited, a rainbow, when placed, appears as 5 diagonal lines of color, that reach from top to bottom of the screen, even passing underground. It does not block anything.
A rainbow in Super Scribblenauts
A rainbow in Scribblenauts Unlimited
What happens when you change a rainbow's size on remix