:For(X,1,N :" "+Ans+" :End :Ans→Str1
With our string stored in Ans, we concatenate (add) a space to the beginning and end of the string. At the same time, the new string is stored to Ans, which is what we use next time through the For( loop. The loop gets repeated over and over again until we have added however many spaces we wanted. If you only want spaces on one side of the string, edit the second line accordingly.
Using Ans allows us to not have to use another string variable, since Ans can act like a string and it gets updated accordingly, and Ans is also faster than a string variable.
We store the string to a more permanent variable (in this case, Str1) for future use. When you are done using Str1, you should clean it up at the end of your program.