The global command marks every line matching a pattern and executes a list of actions on them. Each action is separated by the pipe symbol, |. In
the pattern is ^, so all the lines are marked. Then, three actions are executed on the marked lines:
s/foo/bar/: substitute "foo" by "bar".
+t+: Duplicate the next line. ...
It probably worked only on the current line. You need to specify a range to the substitute command, for example:
There is a shortcut for the range that matches the entire file, which is %:
See :help ranges.