I think I was misunderstanding because I was going the route of running it continually, not once and done.
If you're just running it once, I think you're making it more difficult. By running it as a propertysource, you don't have to do one API GET to grab the displayName and name, you can grab those via tokens. Then all you have to do is a single patch for those devices that don't match. By running it on your laptop, you have to do multiple API calls to get the details about what you want to compare, then another API call to make the change. Not only that, but by making it a PropertySource, you can easily limit it to just the one device without having to change your code.
For security reasons, if you're running it on your laptop, at least set the API key as an environment variable so that you don't accidentally post the token and key again to this publicly available forum.