The list of all trade goods is defined in `lib/goodsindex.lua`, which populates a table `goods`. If you can arrange for your trade good descriptor to be present in this table when `TradingPost.initialize()` calls `TradingManager:generateGoods()`, then trading posts will potentially buy and sell your good.
To be eligible to be produced by some factory you have to also arrange for a production descriptor to be present in a table `productions`, defined in `lib/productionsindex.lua`, when `Factory.initialize()` is called.
The population code for both tables is autogenerated by something we don't seem to have, but it's easy enough to extend both tables without modifying the original population code (e.g. by arranging for files that extend them to be require()'d in the appropriate places).
I don't guarantee that this is all you need to do, but looking at the code that seems to be the gist of it.
If you want some station to have more complex defined behavior, copy `entity/stationscripttemplate.lua`, make it do what you want, and then arrange for it to be added to your new station type when a sector generator script (or something else) creates it in the world.