I can't tell you the exact code, but I can give you an idea on what needs to be done. Basically your going to have to have a program to track the position of the NPC as well as the position of the player. Then you need a program that checks each position, and when the positions are close enough together, let you punch either side, depending on the positions of each character....hope that made sense =D.
As for the static menu. Unfortunately there is no easy way to do this, as in the TK, you can't currently walk around while an RPGCode program is running in the background (as far as I know anyways...). There are ways to get around it, but they're not pretty, and it would take an extreme amount of programming, and in the end, wouldn't be worth it. I wanted to do the same sort of thing in G:A using the GPS system, and have it overlayed on the screen while you walked around. That would've been cool as hell.