Sketchup.active_model.name is quite odd [and somewhat redundant]: you can set, then get, a ‘name’ [used in Model Info>General] quite separately from the ‘title’ which is the saved title of the skp file…
It’s best to use Sketchup.active_model.title to get that…
It returns an empty string “” if the model has never been saved, otherwise it should then return the correct name of the skp as a string…