The |
character is the command separator; with it, you can concatenate multiple Ex commands in a single line, without adding newlines. See :help :bar
.
So, your conditional is equivalent to the following:
if !(line('.')%2)
s/foo/bar/g
endif
Note that some Ex commands consume the entire remainder of the command-line and therefore cannot be directly concatenated with |
. But you can wrap those commands in :execute "{cmd}"
.