As long as you pass in a pilot id as the first parameter of PilotData::GetFieldValue() it shouldn't matter where you put it or if you use it in a loop.
I have checked your code, you have provided this:
<!-- Here i would like to show VATSIM or IVAO ID using the following code -->
l <?php echo PilotData::GetFieldValue($pilot->pilotid, 'VATSIM CID or IVAO VID'); ?>
As I stated above, if you want it to work inside of your pireps page ($pireps loop as you provided) then you will need to swap that line for this one (as I already provided above):
<?php echo PilotData::GetFieldValue($pirep->pilotid, 'VATSIM CID'); ?>
where VATSIM CID is the name of your custom field. Note the change from $pilot to $pirep. If this isn't what you are after then please give further explanation/code so we can help you out.