Phealin
It's very doable, and a sort isn't needed.
You can use "repeat" or "for" to loop over the letters.
Use the len() expression to set the length of the loop, then the mid() expression to get the individual letters.
Next you need to convert the letters to a number. You could do it the long way by making an event for each, or you could use the find() expression [expained below].
Wrapping the value around when adding a number can be do by using the % operator.
Finally converting the number back to a letter can be done with mid() in a similar way to using find().
As an example the following should encode your text.
Global text input="hello"
Global text output=""
Start of layout
set array size to (7,1,1)
set array at 0 to 6
...
set array at 6 to 2
Global text letter=""
Global number value=0
Start of layout
Repeat len(input) times
set letter to mid(input, loopindex, 1)
set value to find("abcdefghijklmnopqrstuvwxyz", letter)
set value to (value+array.at(loopindex%array.width))%26
add mid("abcdefghijklmnopqrstuvwxyz", value, 1) to output
That works any input that consists of only lowercase letters.