When Paul said “Do not go beyond what is written”, was he talking about both


Here is from a trusted commentary

1Th 4:6
Verse 6. That no man go beyond. This word means, to make to go over, as, e.g., a wall or mountain; then, to overpass, to wit, certain limits, to transgress; and then, to go too far, i.e., to go beyond right–hence to cheat or defraud. It is not used elsewhere in the New Testament. The idea of overreaching is that which is implied in its use here.

However, you are right that no one should add or take away from scripture either… Revelation 22:18-19  For I testify unto every man that heareth the words of the prophecy of this book, If any man shall add unto these things, God shall add unto him the plagues that are written in this book: And if any man shall take away from the words of the book of this prophecy, God shall take away his part out of the book of life, and out of the holy city, and from the things which are written in this book.