stats table calc & custom function

I was playing with STATS TABLE CALC. How can I define a function inside a BEGIN-END PROGRAM block and refer to that function in a stats table calc call? In the code below, I try to randomly round cells to multiples of five. I keep getting a message that function "up_or_down" can not be found. Even when I write the code to a .py file that is in a location on pythonpath, I get the same message.

Thank you, got it already. My question was how I should reference a function if that function has been defined in a begin/end program block in the syntax itself. I was close in my attempts, but this works: