As WeeGillis already stated, "open source" and "public domain" are two entirely different things. There are many open source products available that will allow you to modify the code
for your own use, but specifically prohibit the marketing and sale of that product. If it ever came before a judge, I cannot see how you could possibly come out on top.
Your tack of contacting them to investigate acceptable avenues is, IMO, the safest way to proceed. If you decide to reverse engineer the code, you will be effectively stealing their intellectual property.
That said, I have read somewhere (I do not recall where) that functional code snippets are difficult to enforce a claim on, unless a true "uniqueness" of the original product can be satisfactorily proven. In today's world, I think there are few realms in which we can find true programming uniqueness.
Nevertheless, I think the risks outweigh the benefits. Isn't it better to help
enforce appropriate web standards than to help
circumvent them?