I couldn't find much documentation on SET_TEXT_TPE but the most important thing is probably that all lines have to end with ";". If you get a "failed to load error" or something like that, then what you are writting is not a valid .tp line.
The only info I've found is from here:
Create a TP program with KAREL
Can't help you much with 2) there are custom user forms that you can make but I've never gotten it to work.