Hello,
The JavaScript applied in the form on the CRM will not be applied on the portal.
What I suggest for non-code solution,
1. Create a new form specific to the portal
2. Create new view specific to the lookup
3. In the view, apply the filtering you need for the lookup
4. Select this new view in your lookup field placed on the new form
5. In Entity Form of theportal, point to this form
Note: don't forget to give the entity permission for the entity of the lookup to the needed web roles