I'm thinking about not showing much of the HTML and content to the SEs and only show the main content, like an article without other parts of the website like overview of forum threads and the like. Would this help with keyword density and in so doing improve the position of the page in the SERPs? Would this be an offense that would get me a penalty or a ban from the SEs?
Would this help with keyword density and in so doing improve the position of the page in the SERPs
It might help with the optimization of the pages depending on how you did it. That may or may not help with your position in the SERPs. for the last several years this has had more to do with the types and number of links a site gains than what is actually on the site.
Cloaking can be risky, though. It can earn you a penalty.