You can't 'script' a relationship.
You can make a script and use a relationship into your scriptsteps...or script some left or right fields to meet the relationship basis....
The self-join relationship:
There's no standard term for this aspect of relationships. You'll hear the term self-relationship, self-join and same-file relationship.
It merely means that a relationship is used to relate the file (table) to itself.
When creating a relationship, FM asks you to choose a related file (table).
All you have to do to create a self-join relationship is choose the file (table) you are creating the relationship from.
A common technique for this is to use a global field on the left side, since globals shows the same value on all records.
If you give more details of what you want to achieve, we can be of more assistence....
HTH
John