I was trying to call this function as a modal through code but unfortunately when I execute bpy.ops.mesh.transform.resize(long list of values here), it applies the function directly and I want this as a modal just like when I press the "S" key triggered through code.
You can achieve the behavior you desire ( user interaction ) by explicitly passing the execution context (INVOKE_DEFAULT) as the first argument.
The default execution context is 'EXEC_DEFAULT' and is implicit for all operators. In such a case just the execute() method defined for the operator is called using the default or passed operator properties. But in case an operator defines an invoke/modal method and 'INVOKE_DEFAULT' is the execution context, either an operator properties user interface can be used to execute the operator or can be run modally or both.
Further details can be found at the links below: