If I understand your pseudocode correctly, you are...
# suitescript
e
If I understand your pseudocode correctly, you are asking how to do conditional logic based on the record type of the current record's parent?