When you remove a managed solution, all aspects are removed as well and so it should not leave any trace. There are no expected scenarios where installing a managed solution and the removing it should cause script errors when customising forms. I suspect that there is something wrong with the Dynamics CRM online organisation - you should contact Microsoft support.
hth