Profile service is just a wrapper for the regular data store api, it adds extra features such as session locking, and is just more feature packed. My own module relies on ProfileService, so look into the docs of profile service and then you can get an idea of how to script it by looking at my method (or use it of course).