Function arguments go before the "/", variable declarations after, and always good to put a space betwen them. With no "/" its assumed all are arguments, so even if I don't have local variables declared I still add it just for clarity.
Variable useage is always from the inside out. Those defined in the current function are used if declared, if not then the calling function, if not, then *that* calling function, and so on. If a declared variable has the same name as one in a calling function then the local value is used rather than the one declared in the calling function.
Usually it works better to pass values as arguments to a function, then return the processed value. Sometimes this isn't practical, such as complex operations in massively nested lists, so the variable in question would *not* be declared in the sub-function but still referenced, operating on the variable in the calling function. But if this is coming up frequently its a good indication the program flow/logic needs revisiting.