I don't think this is like pandora, its more like spotify or tidal in which you can stream individual songs. You can definitely add apple music streamed songs to playlists through the UI, but I don't know what can done through scripting.
The alfred mini player for iTunes also doesn't do well with apple music songs currently, so I'm guessing some api/applescript entry points for that may not be available.
That being said, if you add a song from apple music to your library even if you don't download it this plugin appears to work, unfortunately that doesn't allow you to listed to a curated playlist or radio station and pick out songs as they come up to add to a playlist...