I feel your pain!
We bought a boat with P4 in - it smoked like no other engine I have ever had, then I bought a reconditioned engine that was probably worse than the first one.
Eventually I gave up and we put a Perkins AD3 in its place and that was a huge improvement. The P4 has a bad reputation, certainly in narrowboats, maybe they just don't get hot enough.
I think you would be better just getting rid of it. Spares are very few and far between, especially for the gear box where they have often rotted out due to sea water causing corrosion of the cooling jacket.
Interesting that you say it runs like 'crap' - mine always started well and sounded nice - it just laid a smoke screen down wherever we went.
Actually thinking about it, it did coke up the heads with monotonous regularity!
Get rid,