I want to execute a certain InputScript when the user presses F8. I tried

On "/8" process= ....

but nothing happens when the user presses F8.

The statement

On "/8" ...

can be used if there is an SAP function F8 already defined for this screen. If not, as in your case, you need to define a new pushbutton and assign F8 to it. Example:

Pushbutton (toolbar) "Some Text" "/0" "F8" process=...