How can I determine the reference in script is Prefab or Gameobject,and how to get the Path of the prefab, thanks

Given an object you can use PrefabUtility.GetPrefabType to determine what it is - for example, a prefab, an instance of a prefab and model etc.

You can get the path of an item using AssetDatabase.GetAssetPath

So to determine if a script reference is to a project item you can use:

 var path = AssetDatabase.GetAssetPath(someObject);

And use this if the item is a project item (technically this could also be a model etc):

  if(!string.IsNullOrEmpty(path)) { //Do Something }

You can also use PrefabUtility.GetPrefabParent(someObject) which will return the prefab which is the source of a scene item or PrefabUtility.GetPrefabObject(someObject) which will return the root of the prefab for any object within it or null if the item isn’t a prefab.