The reason is that inside a single-quoted string double-quoting has no effect. From the POV of the shell, though, you are inside a single-quoted string. This should work:
sed -ie '/#End/i\
'"$command"'\
' /location/of/somescript.sh
Note that the single-quoted string ends, then a double-quoted string starts and when this ends another single-quoted string starts. This may look cumbersome, but it is the only way to ensure the sed-command will not break if "$command" contains whitespace.
Still don't know exactly HOW it works (would like to), but it works fine! I found out that I can add as many lines to the variable as I want. It will insert all.
One last question:
At some point the somescript.sh will look like this:
Use the "a" (append) command of sed with line pattern. For example:
sed '/^pattern/ a \
' /path/to/input
will append a newline to every line which starts with "pattern". Notice that the newline character has to be escaped with "\", which is why the line is separated in two in the above.
As an aside: you probably got no answer any more because people thought you could figure that out yourself. This forum is about helping you help yourself, not doing your work for you. Not to know something is one thing, being to lazy another. You might want to think about that.
I suggest consulting the sed man page ("man sed") to find out how to put more than one command in a sed script. You could also try a book (the one i liked most is Dale Dougherty, "sed & awk", O'Reilly).
If you use GNU sed, you don't need the awkward newline after the i command. So you can write a simpler, easier-to read one-line script.
sed -i '/#End/ i \thing-to-insert' somescript.sh
Also, to eliminate some confusion, you can write the sed script to an external file, and then use -f to execute the script. That can help make the syntax easier to read, and probably avoid some of the complexity related to quoting / not quoting $command.