Bitcoin scriptSig with two transactions to unlock the scriptPubKey
You cannot put your plain script in scriptPubKey hence it's considered non-standard and will not be relayed/mined. You need to hash your custom script, put script hash in P2SH output, and reveal the script later when you spend it (in scriptSig).
Here's a step-by-step demonstration:
OP_SUB &lt; 100 &gt; OP_EQUAL


Convert your script to hexadecimal representation:

a. OP_SUB is encoded as 0x94 (in hex)

0x94

b. 100(dec) is encoded as 0x6400 (in little endian) plus one-byte length prefix

0x94026400

c. OP_EQUAL is encoded as 0x87 (in hex)

0x9402640087


Hash your script in order to get script hash:


RIPEMD160(SHA256(0x9402640087)) =
0xa038dd58be8e9c3bd9f26fe585dcdfe85d70ac4d


Your P2SH scriptPubKey is:


OP_HASH160 a038dd58be8e9c3bd9f26fe585dcdfe85d70ac4d OP_EQUAL

In order to spend/unlock this output your scriptSig should be:

&lt; 200 &gt; &lt; 100 &gt; &lt; OP SUB &lt; 100 &gt; OP EQUAL &gt;

In Hex:

0x02C800026400059402640087

Please note that arithmetic operations like OP_ADD and OP_SUB can only accept 32-bit integers, so if any input encountered longer than 4 bytes, the script must abort and fail.
Feel free to learn more about P2SH here