Hi,
I'm not sure what you mean. You can already use vairants and it already shows them as out of stock when they don't exist. There is nothing particular to do for that, it's out of the box.
This thread is about dynamically updating the characteristic dropdowns on the product page so that the customer cannot select a non-existant variant. That indeed requires custom javascript. The code, if done properly, can be generic so that it will work even when you add new products, variants, characteristics, etc.
PolishedGeek, like other developer partners of ours, has the knowledge to work on such project:
www.hikashop.com/home/our-partners.html
Note also, that a simpler solution is to change the "characteristic selection method" to "list" in the HikaShop configuration in order to display oa list of only the existing variants on the product page. That way, you don't have to code anything. But maybe it won't suits your needs ?