I like the idea and I'd look into selling some code (I have a collection of Sinatra apps I re-use for all sorts of things from APIs to payments). The issue really comes down to support, customization, and deployment. I don't mind writing some documentation once, but I don't want to spend 4 hours supporting something I sold for $299.
Ignore the people that say there's no market. One way I think you make this stand out is with a "verified" badge of sorts. For any project, ensure that it has one or more of the following:
- Dockerfile that works
- Deploys to Heroku with min. effort
- Has a test suite that passes
- Has a working demo
- Includes a minimum amount of documentation/setup videos
That's my 2¢