sir, I dont know if i can help you find the exact problem, but i can help you isolate it!
https://www.boats.net/catalog/johns.../j140tlcos/power-trim-tilt-hydraulic-assembly
if you open the referenced link you can see what should be your trim and tilt unit, these units vary in complexity internally but all the hydraulics are activated by the motor spinning either clockwise or counter clockwise. it sounds like you have been pursuing a fix to this problem via the electrical system but the problem could be inside the tilt and trim unit itself, which would be helpful for you to know (stuck or clogged valve or bad sensor if its so equipped, etc)
to isolate this find item # 78 (motor connector plug) and disconnect it, since you rewired the the trim and tilt wiring yourself i am going to assume you are electrically competent so once you have disconnected the plug get two wires and hook them to a battery's positive and negative post being extremely careful not to short them out. then in the safest way you can connect the wires to the two connections inside the plug, it doesn't matter which one you put where positive or negative because the motor will be activated either way, one way is up and reversing the leads will cause the motor to spin the other direction letting the trim unit go down or vise versa. Testing it this way you are removing the entire electrical wiring in the boat from the trim unit. if it goes up smoothly when you get the wires hooked up in the way that causes that action, then you still have an electrical problem in the wiring going to the trim unit from the boat. if it still moves the motor up in increments as you described, the problem exists solely in the trim unit itself and there could be a number of reasons for that which someone with more hydraulic experience on this forum would need to answer. perhaps it has a stuck valve creating and over pressure and shutting the motor off till its bled off I don't know, but either way you will know to keep looking at the wiring or to focus you efforts on the trim unit itself. hope this helps.