In terms of a
legal matter, I don't believe you can use the HPL Engine to distribute paid content without direct permission from Frictional. I also don't believe you can distribute Amnesia/SOMAs executable or application with any products since that allows someone to play a game created on the HPL2 Engine, likely without consent from FG (the only two exceptions I know of, are A:AMFP and Amnesia: The Second Dimension custom story, which uses a modified Amnesia executable). Distributing the executable is also a potential small gateway for piracy.
In the past, I had used HPL2 for an educational project and at the time, contacted jens for permission, who granted it so long as it remained for educational purposes. As such, I was allowed to use Frictional Games as a team who approached me to make a gameplay trailer for an upcoming unofficial sequel (I had to say they did, not they did), the Amnesia name, the assets, the soundtrack.. Just about everything, except the Source Code. Still had to stick to the Full Conversion scope, which, was fine by me.
--------[I reread your question before I posted and below is what I originally had written. Might still help]--------
The source code for Amnesia has not been released yet. The best you can do for now for creative control in HPL2 is work with either an
Isolated Full Conversion Mod or get really intensive with some of the scripting you do at a Custom Story scope. The
HPL2 Editor Suite contains tools such as the Level Editor, Model Editor, Material Editor, etc for use with Amnesia: The Dark Descent and assets used in Amnesia: A Machine For Pigs.
HPL3's Source code has not been released and is very unlikely to be anytime soon. A design more focused on full control modding has been provided, utilizing editable functions in the /scripts/ directory inside SOMA's installation folder. By changing some of these features around in your mod, you can create an entirely new AI, or a set of mechanics for your own completely different game. SOMA is very much reliant on the /scripts/, /config/ and /lang/ directories, you almost don't even need the source code unless you're someone like Abion47 who needs to access it to find out why he still cannot get custom shaders working yet.