What you are describing is an asynchronous task, meaning, you what it to end when something (values are entered) happens in the system (and raises an event) and not by the user entering/leaving the task.
Define the method as asynchronous (in SWO1) and use a terminating event to end it (in PFTC). This way the workitem will not be completed immediately but only after the event.
Raise the event from your webdynpro screen by calling the SAP_WAPI_CREATE_EVENT function module only after the user entered the relevant values.