I think you're stuck with what you last commanded. You might try the get to see if it works, but I think those only work for input pins. RESOLVED in CODE WALKTHROUGH.
Not necessarily at top of function. If variables are only used in a smaller scope (e.g. an if body), they can be declared at the top of that scope. I prefer they not be declared in the middle of code unless there is a good reason (e.g. a dependency in assignment on code above).