There are two ways to go with that. One is to write your own scripting language parser and the other is to use a pre-existing language.

Writing your own is an interesting project and something i've done many times for different projects. The complexity depends on the language's design and features and can be from something extremely simple (the simplest usable language could be something like Forth) to very complex (something like an interpreted Object Pascal). While it is tempting to shoot for the sky, in most cases all you need is very simple stuff. My LIL language has a very small implementation but it is very flexible and my Alithia 3D Engine uses it for everything (note: these two projects are in C, not Pascal - i'm making a FreePascal implementation of the scripting language but it still doesn't support all commands).

To learn how to make your own scripting languages/engines look on information about parsing, interpreters, etc.

The other option is to use a pre-existing one. I don't know much about the pure FreePascal solutions (i've only heard about some "PascalScript" or something like that but never used it). When i was making a 3D world editor a few years ago in Lazarus i wrote a scripting language for it called SimSAL. Recently i uploaded it to GitHub but the language is mostly untouched since ~2007. I wrote a readme file explaining the language, but feature-wise it is very poor - it doesn't even have subfunctions. If your scripts are very simple it could be usable (my C++ Nikwi game used a much more primitive language than SimSAL so it is possible - just not for bigger scripts).

On how to use a scripting language (your own or existing), there are many ways. One of the simplest is to simply run some code for an entity's event. For example assume you have a TEntity class which amongs others has fields like

Code:
TEntity = class
private
  FTouchCode: string;
protected
  procedure DoTouch(OtherEntity: TEntity); virtual;
public
  property TouchCode: string read FTouchCode write FTouchCode;
end;
The engine will call "DoTouch" when the entity touches (collides) some other entity. DoTouch's default implementation (it is a virtual so that a subclass can implement some other handling in native code) executes the "TouchCode" like

Code:
procedure TEntity.DoTouch(OtherEntity: TEntity);
begin
  SetScriptVariable("OtherEntity", OtherEntity);
  RunScriptCode(FTouchCode);
end;
Of course the "SetScriptVariable" and "RunScriptCode" parts depend on the language/engine you use. Also there might be some differences. For example SimSAL can be compiled so the runtime won't need to parse the code each time you execute it and instead of doing that, you can use a SetTouchCode for the write part of the TouchCode property that sets and compiles the code and have DoTouch execute the compiled code. Also SimSAL doesn't provide any functionality for setting variables (something common with scripting languages that use a compiled form) so you need to register a function that returns the OtherEntity value. LIL, on the other hand, doesn't compile the code but executes it by parsing it each time and does provide functionality for setting variables, however it is a bit slower. Although this shouldn't be a concern since scripts shouldn't do anything CPU intensive anyway - they're the game's "script" but the "actors" should always be in native code.

Anyway, i think that is enough to give you a few starting points. If you have any specific questions, ask :-)