Checking for input is game logic The only things that should be done in render is stuff that directly pertains to drawing; a good example is this other post; in this case it’s ok to put the solution in render() because keeping the character’s gun in sync with the body position is just a cosmetic (rendering) thing.
Keeping rendering and game logic separate is good practice for a multitude of reasons but generally the most obvious is for the timing I mentioned above; most games split their game update and game render so that they can render as much as possible without lagging and still maintain a steady update cycle (for physics etc). If you mix up rendering and update logic then it becomes a lot harder to have consistent and stable timing.
Other reasons for keeping rendering logic separate include code readability (it’s easier to figure out where a particular piece of code might be happening if all your game logic is in update and all your drawing is in render, and not mixed up), code portability (consider that you might want to port your game to a different engine such as starling; if only your rendering code is in the render stuff then that’s all you need to replace. The game logic, update stuff, stays the same), and ‘separation of concerns’.
That last one covers a lot of ground but broadly speaking it’s useful for cases where, for example, you want to switch out the graphics of your game and have your player look different but behave the same. It’s way easier to do this if the drawing-related code is the only thing in your render loop. Of course, thanks to FlashPunk we can just switch the spritemaps around, but it’s good practice to get into a habit of learning good coding practices all the same. In general when programming, you want each and every class (and further, each and every function) to do a minimum of work. You want to ‘separate concerns’ across lots of classes and functions so that you can easily switch out and test individual classes or functions. Learning where to draw the line and stop is something that comes from experience, but keeping update and render logic is one of the most fundamental cases (and as such is even important when using a library such as FlashPunk!).
If you have a required algorithm condition in your render code (note that there shouldn’t be any ‘logic’ in there, only drawing) you should refactor to handle the logic in your update (eg check for key down), store the result in a variable an use the variable in your render to draw the appropriate representation. Never have logic in your render code!
If you want to learn more about good coding practice, separation of concerns and code architecture then have a google for stuff like ‘model view controller pattern’, ‘class encapsulation’, and ‘programming design patterns’.