Your program you wrote will execute just fine in RPN as well. There is no "RPN" programming mode.
Note that when the program is returned from the Toolbox->User->[progname>]->[progfunc] location it returns to the command line as PROGNAME(). You can immediately press enter and it executes taking the ars from the stack. Only in the case of a function that accepts differening numbers of arguments would you put anything inside the () to tell the system how many args to take from the stack.
Although I work for the HP calculator group as a head developer of the HP Prime, the views and opinions I post here are my own.