The main thing I hoped to do was to write into my script the adding of 4 markers in the channel that has the peaks and troughs in at equal intervals for splitting the inspiration or expiration into 20% intervals but the issue would be that each breath in/out will not be the same duration so I was hoping it was possible to add markers not based on time
Well, the markers are added based on time, but those times can be anything you want. So the script code could find the start and end expiration times, and then add a marker at start + ((end-start)/5), another at at start + ((end-start)/5)*2, and so on.
But you don't need to do this! You can find the intermediate points directly using an active cursor search. Say you have set things up so that cursor 0 is at the event for the start time and cursor 1 has found the next event - the end time. Then you could set up cursor 2 to be active in expression mode, with the expression being "C0+((C1-C0)/5)", and repeat with cursors 3, 4 and 4 to get the other positions.