How to relate the sampling frequency to the measurement error for this kind of pulse period measurements?
If you have consecutive samples that indicate the waveform has passed through the green line all you can say is that the waveform passed from below to above (or vice versa), somewhere in the time frame formed by 1 sample period of 4 kHz (i.e. +/- 125 us).

If your sampling is 8 kHz then the accuracy is +/- 62.5 us.

If you are trying to measure the period your result can be off by twice this amount (worst case). That's for one measurement and clearly, if there are multiple measurements that can be made (because the period varies very gradually) then averaging is your friend.

The rise time is irrelevant unless it was so slow that it caused noise jitters close to where the waveform passes the green line.