Sorry if it wasn't clear, I'll try to clarify.
So, extracting the genes for any given pathway isn't difficult, there are even several R packages which allow one to extract a list of genes from a pathway ID.
What I need specifically is a way of defining the "end point" of the pathway, so you've rather hit the nail on the head with your own question. Using the example of MAPK signalling from KEGG you have a series of reactions happening with genes/proteins interacting with other genes/proteins downstream (so TNF interacts with TNFR interacts with TRADD etc etc down to p53 which seems to be a defined "end point"). What I want to be able to do is to list the genes in the order of the interactions (so TNF would be high on the list, while p53 would be low).
Naturally there are a number of issues I can see with this already such as concurrent or parallel interactions, but there would still be some higher in the list and some lower. At least this is how I imagine it. Does that clarify what I meant?