RE: Filtering options for a subgrid lookup.
I would suggest to create a middle entity.
Example: If you want to filter Contacts in a subgrid an an Account form base on a custom lookup field (Say, myCustomLookupField), then you can do the following.
1. Create a middle entity - Say "AccountContactMiddle"
2. Add lookup of Account, Contact and myCustomLookupField on AccountContactMiddle's form.
3. Configure the Contact Lookup to get filtered as per myCustomLookupField lookup field ( User "Only show Related Records" OOTB setting)
4. Add Field Mappings from Account for the field myCustomLookupField
5. You are done.
The Only drawback is the data duplication, but this is No Code solution
Will be glad to hear your feedback.