All AppMeasurement plugins would be deployed inside the Analytics tool in DTM. You would need to ensure your library management setting is set to custom. This will allow you to open an editor that looks similar to if you were to deploy the AppMeasurement file directly to your site. Once you've gotten to this point, you should be able to deploy the plugin using the documentation.
Once the function is deployed in the do plugins section, you could set up a data element using a custom script to fire the function call.
Once the data element is setup, you would set whichever eVar you're using equal to the data element.
Please let me know if you have additional questions.
That seems like a viable solution as well. The only difference I can think of off the top of my head would be the image request. Using the getValOnce plug-in would prevent the value from being passed to Analytics via the request more than the first time whereas your method would include the date in multiple image requests. This might inflate metrics like instances if that is important to your use case.
Essentially, you can do the deduplication on the client side with the plug-in, or you can do it on the back end with Analytics allocation.